Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SRVResolver = func(serviceName, srvName string) ([]*url.URL, error) { _, records, err := net.LookupSRV(serviceName, "udp", srvName) if err != nil { return nil, err } urls := make([]*url.URL, len(records)) for i := range records { urls[i] = &url.URL{Scheme: util.DiscoveryDirectProtocol, Host: net.JoinHostPort(strings.TrimSuffix(records[i].Target, "."), fmt.Sprint(records[i].Port))} } return urls, nil }
Functions ¶
This section is empty.
Types ¶
type Dialer ¶
func (*Dialer) Dial ¶
Dial creates a connection to a channel with "URL". This URL can be a URL from a discovery server, or a protocol registered in `RegisterProtocol`.
type DialerContext ¶
type DiscoveryConfig ¶
type Protocol ¶
func DiscoveryProtocol ¶
func DiscoveryProtocol(TransportProtocol string, Config *DiscoveryConfig) Protocol
Dial to an empty path means dial to the discovery server itself.
func NetDialerProtocol ¶
func NetDialerProtocol(network string, dialer DialerContext) Protocol
Click to show internal directories.
Click to hide internal directories.