Documentation
¶
Index ¶
- Constants
- Variables
- func ParseScheme(addr string) (scheme string)
- func RegisterTransport(t Transport)
- func RegisterTransportWithScheme(t Transport, scheme string)
- func ResolveTCPAddr(addr string) (*net.TCPAddr, error)
- func StripScheme(t Transport, addr string) (a string, err error)
- type Address
- type Connection
- type Dialer
- type Listener
- type Transport
Constants ¶
const ( ErrConnRefused = errs.Err("connection refused") ErrNotListening = errs.Err("not listening") )
errors
Variables ¶
var ( // OptionDomains is option's domain OptionDomains = []string{"transport"} // Options for transport Options = transportOptions{} )
Functions ¶
func ParseScheme ¶
ParseScheme parse scheme from address
func RegisterTransport ¶
func RegisterTransport(t Transport)
RegisterTransport is used to register the transport globally, after which it will be available for all sockets. The transport will override any others registered for the same scheme.
func RegisterTransportWithScheme ¶
RegisterTransportWithScheme register transport as an alias scheme
func ResolveTCPAddr ¶
ResolveTCPAddr is like net.ResolveTCPAddr, but it handles the wildcard used in nanomsg URLs, replacing it with an empty string to indicate that all local interfaces be used.
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
Address is transport Connection's address as net.Addr
type Connection ¶
type Connection interface { Transport() Transport net.Conn Writev(v ...[]byte) (int64, error) LocalAddress() string RemoteAddress() string RawConn() net.Conn }
Connection is connection between peers.
func NewConnection ¶
NewConnection allocates a new Connection using the net.Conn
type Dialer ¶
type Dialer interface {
Dial(opts options.Options) (Connection, error)
}
Dialer is dialer
type Listener ¶
type Listener interface { Listen(opts options.Options) error Accept(opts options.Options) (Connection, error) Close() error }
Listener is listener
type Transport ¶
type Transport interface { Scheme() string NewDialer(address string) (Dialer, error) NewListener(address string) (Listener, error) }
Transport is transport
func GetTransport ¶
GetTransport is used by a socket to lookup the transport for a given scheme.
func GetTransportFromAddr ¶
GetTransportFromAddr get transport for the address scheme
Directories
¶
Path | Synopsis |
---|---|
Package all is used to register all transports.
|
Package all is used to register all transports. |
Package ipc implements the IPC transport on top of UNIX domain sockets.
|
Package ipc implements the IPC transport on top of UNIX domain sockets. |