Add String method to all interfaces

This commit is contained in:
Asim
2015-12-19 21:56:14 +00:00
parent d7b3765c71
commit be43d827c7
17 changed files with 73 additions and 0 deletions

View File

@@ -308,6 +308,10 @@ func (h *httpTransport) Listen(addr string) (Listener, error) {
}, nil
}
func (h *httpTransport) String() string {
return "http"
}
func newHttpTransport(addrs []string, opt ...Option) *httpTransport {
return &httpTransport{}
}

View File

@@ -26,6 +26,7 @@ type Listener interface {
type Transport interface {
Dial(addr string, opts ...DialOption) (Client, error)
Listen(addr string) (Listener, error)
String() string
}
type options struct{}
@@ -59,3 +60,7 @@ func Dial(addr string, opts ...DialOption) (Client, error) {
func Listen(addr string) (Listener, error) {
return DefaultTransport.Listen(addr)
}
func String() string {
return DefaultTransport.String()
}