Versions in this module Expand all Collapse all v1 v1.0.0 Nov 13, 2018 Changes in this version + func MessageMetaVisit(nameRule string, callback func(meta *MessageMeta) bool) error + func MessageSize(msg interface{}) int + func MessageToID(msg interface{}) int + func MessageToName(msg interface{}) string + func MessageToString(msg interface{}) string + func NewError(s string) error + func NewErrorContext(s string, context interface{}) error + func QueuedCall(queue EventQueue, callback func()) + func RegisterHttpMeta(meta *HttpMeta) + func SessionQueuedCall(ses Session, callback func()) + type CloseReason int32 + const CloseReason_IO + const CloseReason_Manual + func (self CloseReason) String() string + type Codec interface + Decode func(data interface{}, msgObj interface{}) error + Encode func(msgObj interface{}, ctx ContextSet) (data interface{}, err error) + MimeType func() string + Name func() string + type ContextSet interface + FetchContext func(key, valuePtr interface{}) bool + GetContext func(key interface{}) (interface{}, bool) + SetContext func(key interface{}, v interface{}) + type Error struct + func (self *Error) Error() string + type Event interface + Message func() interface{} + Session func() Session + type EventCallback func(ev Event) + type EventHooker interface + OnInboundEvent func(input Event) (output Event) + OnOutboundEvent func(input Event) (output Event) + type EventQueue interface + EnableCapturePanic func(v bool) + Post func(callback func()) + StartLoop func() EventQueue + StopLoop func() EventQueue + Wait func() + func NewEventQueue() EventQueue + type GenericPeer interface + type HTTPAcceptor interface + SetFileServe func(dir string, root string) + SetTemplateDelims func(delimsLeft, delimsRight string) + SetTemplateDir func(dir string) + SetTemplateExtensions func(exts []string) + SetTemplateFunc func(f []template.FuncMap) + type HTTPConnector interface + Request func(method, path string, raw interface{}) (interface{}, error) + type HTTPSession interface + Request func() *http.Request + type HttpMeta struct + Method string + Path string + RequestCodec Codec + RequestType reflect.Type + ResponseCodec Codec + ResponseType reflect.Type + func HttpMetaByMethodURL(method, url string) *HttpMeta + func HttpMetaByRequestType(method string, t reflect.Type) *HttpMeta + func HttpMetaByResponseType(method string, t reflect.Type) *HttpMeta + func (self *HttpMeta) RequestTypeName() string + func (self *HttpMeta) ResponseTypeName() string + type MessageMeta struct + Codec Codec + ID int + Type reflect.Type + func MessageMetaByFullName(name string) *MessageMeta + func MessageMetaByID(id int) *MessageMeta + func MessageMetaByMsg(msg interface{}) *MessageMeta + func MessageMetaByType(t reflect.Type) *MessageMeta + func RegisterMessageMeta(meta *MessageMeta) *MessageMeta + func (self *MessageMeta) FullName() string + func (self *MessageMeta) GetContext(name string) (interface{}, bool) + func (self *MessageMeta) NewType() interface{} + func (self *MessageMeta) SetContext(name string, data interface{}) *MessageMeta + func (self *MessageMeta) TypeName() string + type MessageTransmitter interface + OnRecvMessage func(ses Session) (msg interface{}, err error) + OnSendMessage func(ses Session, msg interface{}) error + type Peer interface + Start func() Peer + Stop func() + TypeName func() string + type PeerProperty interface + Address func() string + Name func() string + Queue func() EventQueue + SetAddress func(v string) + SetName func(v string) + SetQueue func(v EventQueue) + type Pipe struct + func NewPipe() *Pipe + func (self *Pipe) Add(msg interface{}) + func (self *Pipe) Pick(retList *[]interface{}) (exit bool) + func (self *Pipe) Reset() + type RawPacket struct + MsgData []byte + MsgID int + func (self *RawPacket) Message() interface{} + type RecvMsgEvent struct + Msg interface{} + Ses Session + func (self *RecvMsgEvent) Message() interface{} + func (self *RecvMsgEvent) Reply(msg interface{}) + func (self *RecvMsgEvent) Send(msg interface{}) + func (self *RecvMsgEvent) Session() Session + type SendMsgEvent struct + Msg interface{} + Ses Session + func (self *SendMsgEvent) Message() interface{} + func (self *SendMsgEvent) Session() Session + type Session interface + Close func() + ID func() int64 + Peer func() Peer + Raw func() interface{} + Send func(msg interface{}) + type SessionAccepted struct + func (self *SessionAccepted) String() string + func (self *SessionAccepted) SystemMessage() + type SessionAccessor interface + CloseAllSession func() + GetSession func(int64) Session + SessionCount func() int + VisitSession func(func(Session) bool) + type SessionCloseNotify struct + func (self *SessionCloseNotify) String() string + func (self *SessionCloseNotify) SystemMessage() + type SessionClosed struct + Reason CloseReason + func (self *SessionClosed) String() string + func (self *SessionClosed) SystemMessage() + type SessionConnectError struct + func (self *SessionConnectError) String() string + func (self *SessionConnectError) SystemMessage() + type SessionConnected struct + func (self *SessionConnected) String() string + func (self *SessionConnected) SystemMessage() + type SessionInit struct + func (self *SessionInit) String() string + func (self *SessionInit) SystemMessage() + type TCPAcceptor interface + Port func() int + type TCPConnector interface + Port func() int + ReconnectDuration func() time.Duration + Session func() Session + SetReconnectDuration func(time.Duration) + SetSessionManager func(raw interface{}) + type TCPSocketOption interface + SetMaxPacketSize func(maxSize int) + SetSocketBuffer func(readBufferSize, writeBufferSize int, noDelay bool) + SetSocketDeadline func(read, write time.Duration) + type UDPAcceptor interface + SetSessionTTL func(dur time.Duration) + type UDPConnector interface + Session func() Session + type WSAcceptor interface + SetHttps func(certfile, keyfile string)