Documentation ¶
Index ¶
Constants ¶
View Source
const ( MsgTypeRequest uint8 = 1 MsgTypeResponse uint8 = 2 MsgTypeClose uint8 = 3 // TODO: for close session )
Variables ¶
View Source
var (
ErrMessageDataTooShort = errors.New("message data is too short")
)
View Source
var (
ErrNoHandler = errors.New("no such handler")
)
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) SetRequestHandler ¶
func (manager *Manager) SetRequestHandler(hdr RequestHandler)
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) IterBuffered ¶
Returns a buffered iterator which could be used in a for range loop.
type PoolTuple ¶
Used by the Iter & IterBuffered functions to wrap two variables together over a channel,
type RequestHandler ¶
RequestHandler define request-response handler func
type RequestHandlerFunc ¶
type Route ¶
type Route struct { Action string Handler RequestHandlerFunc }
type Session ¶
type Session struct { ID uint32 // contains filtered or unexported fields }
func (*Session) HandleResponse ¶
func (*Session) SendAndWait ¶
func (*Session) SendJSONAndWait ¶
Click to show internal directories.
Click to hide internal directories.