Documentation ¶
Index ¶
Constants ¶
View Source
const CLIENT_BUFFER_SZ = 1024
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientHandler ¶
type ClientHandler struct {
// contains filtered or unexported fields
}
func NewClientHandler ¶
func NewClientHandler(conn *net.Conn, server *Server, timeout int) *ClientHandler
func (*ClientHandler) Command ¶
func (client *ClientHandler) Command(cmd giot_packet.Command, data []byte)
func (*ClientHandler) Context ¶
func (client *ClientHandler) Context() context.Context
func (*ClientHandler) Execute ¶
func (client *ClientHandler) Execute(cmd giot_packet.Command, data giot_packet.Data)
type ClientState ¶
type ClientState uint8
const ( CLIENT_STATE_CLOSE ClientState = iota CLIENT_STATE_CONNECTING CLIENT_STATE_CONNECT CLIENT_STATE_READIKNG_PAYLOAD )
type CommandExecutor ¶
type CommandExecutor func(client *ClientHandler, data giot_packet.Data)
type CommandHandler ¶
type CommandHandler func(client *ClientHandler, data giot_packet.Data) (giot_packet.RespStatus, *bytes.Buffer)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ClientAuth ¶
func (*Server) On ¶
func (svr *Server) On(cmd giot_packet.Command, handler CommandHandler)
func (*Server) OnExecute ¶
func (svr *Server) OnExecute(cmd giot_packet.Command, handler CommandExecutor)
Click to show internal directories.
Click to hide internal directories.