Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuffersWriter ¶
BuffersWriter defines writev for optimized syscall
type Factory ¶
type Factory interface {
// Schemes supported schemes.
Schemes() Schemes
// Connect to the peer with the specified address.
Connect(options *Options) (Transport, error)
// Listen for an address and accept the connection request.
Listen(options *Options) (Acceptor, error)
}
Factory defines transport factory
type Option ¶
Option defines option function
func WithContext ¶
WithContext to hold other configure pass by context.WithValue
type Options ¶
type Options struct {
// In server side: listen address.
// In client side: connect address.
Address *url.URL
// Other configure pass by context.WithValue
Context context.Context
}
Options for transport
func ParseOptions ¶
ParseOptions parse options
func (*Options) AddressWithoutHost ¶
AddressWithoutHost convert host:port to :port
type Transport ¶
type Transport interface {
net.Conn
// BuffersWriter for optimized syscall
BuffersWriter
// Flush flush buffer.
Flush() error
// RawTransport raw transport object.
RawTransport() interface{}
}
Transport defines a transport
func BufferedTransport ¶
BufferedTransport for optimize system calls with bufio.Reader
Click to show internal directories.
Click to hide internal directories.