protocal

package
v0.0.0-...-c328704 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Forward

func Forward(c1, c2 net.Conn)

func Serve

func Serve(ln net.Listener, newHandler NewProtocalHandler)

Types

type HandshakeHandleFunc

type HandshakeHandleFunc func(proto *Protocal, cmd string, details []byte) error

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

func NewProtocal(conn net.Conn) *Protocal

func NewProtocalWithParent

func NewProtocalWithParent(parent *Protocal, conn net.Conn) *Protocal

func (*Protocal) Emit

func (proto *Protocal) Emit(event string, details interface{}) (err error)

func (*Protocal) Forward

func (proto *Protocal) Forward(conn net.Conn)

func (*Protocal) Handle

func (proto *Protocal) Handle()

func (*Protocal) Multiplex

func (proto *Protocal) Multiplex(isClient bool) muxado.Session

func (*Protocal) Reply

func (proto *Protocal) Reply(cmd string, details interface{}) error

func (*Protocal) Request

func (proto *Protocal) Request(cmd string, details interface{})

func (*Protocal) Shutdown

func (proto *Protocal) Shutdown(err error)

func (*Protocal) Wait

func (proto *Protocal) Wait() error

type ProtocalHandler

type ProtocalHandler interface {
	Handle()
	Request(cmd string, details interface{})
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL