Add new TCP NameAddress type
parent
e5a8a209e0
commit
5e11584c90
@ -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
|
||||||
|
}
|
Loading…
Reference in New Issue