mirror of
https://github.com/rqlite/rqlite.git
synced 2022-10-30 02:37:32 +03:00
Add new TCP NameAddress type
This commit is contained in:
17
tcp/name_address.go
Normal file
17
tcp/name_address.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user