Documentation
¶
Index ¶
- type Context
- type Engine
- func (E *Engine) AddCommand(command string, handlers ...HandlerFunc)
- func (E *Engine) AddHandler(command string, method HandlerMethod, handlers ...HandlerFunc) error
- func (E *Engine) AddJSON(command string, handlers ...HandlerFunc)
- func (E *Engine) GetCollection() sockets.CollectionInterface
- func (E Engine) New(collection sockets.CollectionInterface, handshakeProcessor handshake.Interface) *Engine
- func (E *Engine) ParseData(input []byte) (HandlerMethod, sockets.Request)
- func (E *Engine) ReadMessage(connection *sockets.Connection, msg []byte)
- func (E *Engine) ReadMessageWithEngine(connection *sockets.Connection, msg []byte, engine Interface)
- func (E *Engine) Run()
- type Handler
- type HandlerFunc
- type HandlerMethod
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Connection *sockets.Connection Engine Interface Data interface{} Params interface{} RequestData []byte }
func (*Context) GetDataMap ¶
type Engine ¶
type Engine struct { Handlers map[string][]*Handler Collection sockets.CollectionInterface HandshakeProcessor handshake.Interface }
func (*Engine) AddCommand ¶
func (E *Engine) AddCommand(command string, handlers ...HandlerFunc)
func (*Engine) AddHandler ¶
func (E *Engine) AddHandler(command string, method HandlerMethod, handlers ...HandlerFunc) error
func (*Engine) AddJSON ¶
func (E *Engine) AddJSON(command string, handlers ...HandlerFunc)
func (*Engine) GetCollection ¶
func (E *Engine) GetCollection() sockets.CollectionInterface
func (*Engine) ParseData ¶
func (E *Engine) ParseData(input []byte) (HandlerMethod, sockets.Request)
func (*Engine) ReadMessage ¶
func (E *Engine) ReadMessage(connection *sockets.Connection, msg []byte)
func (*Engine) ReadMessageWithEngine ¶
func (E *Engine) ReadMessageWithEngine(connection *sockets.Connection, msg []byte, engine Interface)
type Handler ¶
type Handler struct { Method HandlerMethod HandlerFunc HandlerFunc }
type HandlerFunc ¶
type HandlerFunc func(context *Context)
type HandlerMethod ¶
type HandlerMethod int
const ( COMMAND_HANDLER HandlerMethod = 0 JSON_HANDLER HandlerMethod = 1 )
type Interface ¶
type Interface interface { AddCommand(command string, handlers ...HandlerFunc) AddHandler(command string, method HandlerMethod, handlers ...HandlerFunc) error AddJSON(command string, handlers ...HandlerFunc) GetCollection() sockets.CollectionInterface ReadMessage(connection *sockets.Connection, msg []byte) Run() }
Click to show internal directories.
Click to hide internal directories.