Documentation
¶
Index ¶
- Constants
- func AddAddressParser(addressParser AddressParser)
- func NewDialerWithLocalBinding(addressType string, timeout time.Duration, localBinding string) (*net.Dialer, error)
- func ResolveInterface(toResolve string) (*net.Interface, error)
- func ResolveLocalBinding(localBinding string) (net.IP, error)
- type Address
- type AddressParser
- type Configuration
- type Conn
- type ConnectionDetail
- type HostPortAddress
- type ProxyConfiguration
- type ProxyType
Constants ¶
View Source
const ( KeyProxy = "proxy" KeyProtocol = "protocol" KeyCachedProxyConfiguration = "cachedProxyConfiguration" KeyHandshakeTimeout = "handshakeTimeout" KeyCachedHandshakeTimeout = "cachedHandshakeTimeout" )
View Source
const ( DefaultWsWriteTimeout = time.Second * 10 DefaultWsReadTimeout = time.Second * 5 DefaultWsIdleTimeout = time.Second * 120 DefaultWsPongTimeout = time.Second * 60 DefaultWsPingInterval = (DefaultWsPongTimeout * 9) / 10 DefaultWsHandshakeTimeout = time.Second * 10 DefaultWsReadBufferSize = 4096 DefaultWsWriteBufferSize = 4096 DefaultWsEnableCompression = true )
Variables ¶
This section is empty.
Functions ¶
func AddAddressParser ¶
func AddAddressParser(addressParser AddressParser)
AddAddressParser adds an AddressParser to the globally-configured address parsers.
func NewDialerWithLocalBinding ¶
func NewDialerWithLocalBinding(addressType string, timeout time.Duration, localBinding string) (*net.Dialer, error)
NewDialerWithLocalBinding creates a dialer and sets the local ip used for dialing
func ResolveInterface ¶
Resolve a network interface by name or IP address
Types ¶
type Address ¶
type Address interface { Dial(name string, i *identity.TokenId, timeout time.Duration, tcfg Configuration) (Conn, error) DialWithLocalBinding(name string, binding string, i *identity.TokenId, timeout time.Duration, tcfg Configuration) (Conn, error) Listen(name string, i *identity.TokenId, acceptF func(Conn), tcfg Configuration) (io.Closer, error) MustListen(name string, i *identity.TokenId, acceptF func(Conn), tcfg Configuration) io.Closer String() string Type() string }
Address implements the functionality provided by a generic "address".
func ParseAddress ¶
ParseAddress uses the globally-configured AddressParser instances to parse an address.
type AddressParser ¶
AddressParser implements the functionality provided by an "address parser".
type Configuration ¶
type Configuration map[interface{}]interface{}
func (Configuration) GetHandshakeTimeout ¶ added in v2.0.143
func (self Configuration) GetHandshakeTimeout() (time.Duration, error)
func (Configuration) GetProxyConfiguration ¶ added in v2.0.100
func (self Configuration) GetProxyConfiguration() (*ProxyConfiguration, error)
func (Configuration) Protocols ¶ added in v2.0.95
func (self Configuration) Protocols() []string
Protocols returns supported or requested application protocols (used for ALPN support)
type Conn ¶
type Conn interface { Detail() *ConnectionDetail PeerCertificates() []*x509.Certificate net.Conn }
Conn represents an abstract connection
type ConnectionDetail ¶
func (*ConnectionDetail) String ¶
func (cd *ConnectionDetail) String() string
type HostPortAddress ¶ added in v2.0.94
type ProxyConfiguration ¶ added in v2.0.100
func LoadProxyConfiguration ¶ added in v2.0.100
func LoadProxyConfiguration(cfg map[interface{}]interface{}) (*ProxyConfiguration, error)
Click to show internal directories.
Click to hide internal directories.