Documentation
¶
Index ¶
- type AuthorizedCallback
- type ClientConnCallback
- type CloseCallback
- type ConnCallback
- type ExitCallback
- type IClient
- type ICodec
- type IConnection
- type IIOModule
- type IPacket
- type IServer
- type ISession
- type ITcpConnection
- type IWSConnection
- type IWSServer
- type MethodType
- type MsgCallback
- type NewIOModuleCallback
- type Packet
- func (p *Packet) GetData() []byte
- func (p *Packet) GetId() string
- func (p *Packet) GetSequence() uint64
- func (p *Packet) GetSessionId() string
- func (p *Packet) GetStatus() int
- func (p *Packet) SetData(data []byte)
- func (p *Packet) SetId(id interface{})
- func (p *Packet) SetSequence(sequence uint64)
- func (p *Packet) SetSessionId(sessionId string)
- func (p *Packet) SetStatus(status int)
- type ParseDataCallback
- type ParseMethodNameCallback
- type SerializeDataCallback
- type ServeObj
- type WriteCompleteCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizedCallback ¶
type AuthorizedCallback func(IConnection, IPacket) bool
type ClientConnCallback ¶
type CloseCallback ¶
type CloseCallback func(IConnection)
type ConnCallback ¶
type ConnCallback func(IConnection)
type ExitCallback ¶
type ExitCallback func()
type IClient ¶
type IClient interface {
Name() string
Connect() IConnection
Close() bool
SetRetry(bool)
SetCodec(ICodec)
SetIOModule(IIOModule)
SetConnCallback(ConnCallback)
SetMsgCallback(MsgCallback)
SendData([]byte)
SendDataById(string, []byte)
SendPacket(IPacket)
SendDataAwait([]byte) (IPacket, error)
SendDataByIdAwait(string, []byte) (IPacket, error)
SendPacketAwait(IPacket) (IPacket, error)
GetConn() IConnection
}
type IConnection ¶
type IConnection interface {
GetId() string
LocalAddr() string
RemoteAddr() string
Close() bool
IsClosed() bool
OnConnection()
ReadPacket(IPacket)
WriteData([]byte)
WriteDataById(string, []byte)
WritePacket(IPacket)
WriteDataAwait([]byte) (IPacket, error)
WriteDataByIdAwait(string, []byte) (IPacket, error)
WritePacketAwait(IPacket) (IPacket, error)
WriteComplete()
SetContext(interface{}, interface{})
GetContext(interface{}) interface{}
DelContext(interface{})
UpdateCodec(ICodec)
}
type IServer ¶
type IServer interface {
Host() string
Name() string
Serve()
Stop()
SetCodec(ICodec)
SetNewIOModuleCallback(NewIOModuleCallback)
SetConnCallback(ConnCallback)
SetMsgCallback(MsgCallback)
SetExitCallback(ExitCallback)
SetAuthorizedCallback(AuthorizedCallback)
SetWriteCompleteCallback(WriteCompleteCallback)
}
type ISession ¶
type ISession interface {
//GetServeObj() ServeObj
GetConnId() string
GetSessionId() string
Close() bool
CloseSession() bool
WritePacket(IPacket)
WriteData([]byte)
WriteDataById(string, []byte)
WritePacketAwait(IPacket) (IPacket, error)
WriteDataAwait([]byte) (IPacket, error)
WriteDataByIdAwait(string, []byte) (IPacket, error)
OnService(ISession, IPacket) bool
SetContext(key, value interface{})
GetContext(key interface{}) interface{}
SetPacket(IPacket)
GetPacket() IPacket
}
type ITcpConnection ¶
type IWSConnection ¶
type MethodType ¶
type MsgCallback ¶
type MsgCallback func(IConnection, IPacket)
type NewIOModuleCallback ¶
type NewIOModuleCallback func(IConnection) IIOModule
type Packet ¶
type Packet struct {
// contains filtered or unexported fields
}
func (*Packet) GetSequence ¶
func (*Packet) GetSessionId ¶
func (*Packet) SetSequence ¶
func (*Packet) SetSessionId ¶
type ParseDataCallback ¶
type ParseMethodNameCallback ¶
type SerializeDataCallback ¶
type SerializeDataCallback func(interface{}, ...interface{}) []byte
type WriteCompleteCallback ¶
type WriteCompleteCallback func(IConnection)
Click to show internal directories.
Click to hide internal directories.