Add new TCP NameAddress type

This commit is contained in:
Philip O'Toole
2022-02-03 22:35:13 -05:00
parent e5a8a209e0
commit 5e11584c90

17
tcp/name_address.go Normal file
View File

@@ -0,0 +1,17 @@
package tcp
// NameAddress wraps a string and implements the
// net.Listener interface.
type NameAddress struct {
Address string
}
// Network returns the network type. Always returns "tcp".
func (n NameAddress) Network() string {
return "tcp"
}
// String returns the address.
func (n NameAddress) String() string {
return n.Address
}