Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HandshakeData = []byte("EMUX ") DefaultHandshake = NewHandshake(HandshakeData) )
DefaultHandshake 0 5 +---------+---------+---------+---------+---------+ | "EMUX " | +---------+---------+---------+---------+---------+
View Source
var (
ErrTimeout = fmt.Errorf("timeout")
)
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd uint8
const ( CmdConnect Cmd = 0xa0 // create a connect stream, with both command and stream id CmdConnected Cmd = 0xa1 // reply to connect, with both command and stream id CmdDisconnect Cmd = 0xc0 // disconnect a stream and report the reason, with both command and stream id CmdDisconnected Cmd = 0xc1 // reply to disconnect, with both command and stream id CmdData Cmd = 0xb0 // data packet, all fields )
type Decode ¶
type Decode struct {
// contains filtered or unexported fields
}
func (*Decode) ReadUvarint ¶
type Dialer ¶
type Dialer interface {
DialContext(ctx context.Context, network, address string) (net.Conn, error)
}
Dialer contains options for connecting to an address.
type DialerSession ¶
type DialerSession struct { BytesPool BytesPool Logger Logger Handshake Handshake // contains filtered or unexported fields }
func NewDialer ¶
func NewDialer(dialer Dialer) *DialerSession
func (*DialerSession) DialContext ¶
type Encode ¶
type Encode struct {
// contains filtered or unexported fields
}
func (*Encode) WriteBytes ¶
func (*Encode) WriteUvarint ¶
type ListenConfig ¶
type ListenConfig interface {
Listen(ctx context.Context, network, address string) (net.Listener, error)
}
ListenConfig contains options for listening to an address.
type ListenConfigSession ¶
type ListenConfigSession struct { Logger Logger BytesPool BytesPool Handshake Handshake // contains filtered or unexported fields }
func NewListenerConfig ¶
func NewListenerConfig(listener ListenConfig) *ListenConfigSession
type ListenerSession ¶
type ListenerSession struct { BytesPool BytesPool Logger Logger Handshake Handshake // contains filtered or unexported fields }
func NewListener ¶
func NewListener(ctx context.Context, listener net.Listener) *ListenerSession
func (*ListenerSession) Addr ¶
func (l *ListenerSession) Addr() net.Addr
func (*ListenerSession) Close ¶
func (l *ListenerSession) Close() error
type Logger ¶
type Logger interface {
Println(v ...interface{})
}
Logger is the interface for logging.
type Session ¶
func NewSession ¶
func NewSession(s io.ReadWriteCloser) *Session
Click to show internal directories.
Click to hide internal directories.