Documentation ¶
Index ¶
- func Forward(c1, c2 net.Conn)
- func Serve(ln net.Listener, newHandler NewProtocalHandler)
- type HandshakeHandleFunc
- type HandshakeIncoming
- type HandshakeOutgoing
- type NewProtocalHandler
- type Protocal
- func (proto *Protocal) Emit(event string, details interface{}) (err error)
- func (proto *Protocal) Forward(conn net.Conn)
- func (proto *Protocal) Handle()
- func (proto *Protocal) Multiplex(isClient bool) muxado.Session
- func (proto *Protocal) Reply(cmd string, details interface{}) error
- func (proto *Protocal) Request(cmd string, details interface{})
- func (proto *Protocal) Shutdown(err error)
- func (proto *Protocal) Wait() error
- type ProtocalHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
func Serve(ln net.Listener, newHandler NewProtocalHandler)
Types ¶
type HandshakeHandleFunc ¶
type HandshakeIncoming ¶
type HandshakeIncoming struct { Command string `json:"cmd"` Details json.RawMessage `json:"details"` }
type HandshakeOutgoing ¶
type HandshakeOutgoing struct { Command string `json:"cmd"` Details interface{} `json:"details"` }
type NewProtocalHandler ¶
type NewProtocalHandler func(net.Conn) ProtocalHandler
type Protocal ¶
type Protocal struct { On HandshakeHandleFunc // contains filtered or unexported fields }
func NewProtocal ¶
type ProtocalHandler ¶
type ProtocalHandler interface { Handle() Request(cmd string, details interface{}) }
Click to show internal directories.
Click to hide internal directories.