Documentation ¶
Index ¶
- func NewSeqno() string
- type ConnContext
- type ConnHandler
- type Group
- type MessageBody
- type MessageContext
- func (c *MessageContext) Abort()
- func (c *MessageContext) AbortWithError(err error)
- func (c *MessageContext) Context() context.Context
- func (c *MessageContext) IsAborted() bool
- func (c *MessageContext) Next()
- func (c *MessageContext) ShouldBindJson(v interface{}) error
- func (c *MessageContext) WithContext(ctx context.Context) *MessageContext
- func (c *MessageContext) WriteMessage(data []byte) error
- type MessageHandler
- type RespBody
- type SendBody
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConnContext ¶
type ConnContext struct { Conn *websocket.Conn Server *Server Error error // contains filtered or unexported fields }
func (*ConnContext) Abort ¶
func (c *ConnContext) Abort()
func (*ConnContext) AbortWithError ¶
func (c *ConnContext) AbortWithError(err error)
func (*ConnContext) Context ¶
func (c *ConnContext) Context() context.Context
func (*ConnContext) IsAborted ¶
func (c *ConnContext) IsAborted() bool
func (*ConnContext) Next ¶
func (c *ConnContext) Next()
func (*ConnContext) WithContext ¶
func (c *ConnContext) WithContext(ctx context.Context) *ConnContext
type ConnHandler ¶
type ConnHandler func(c *ConnContext)
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) Group ¶
func (g *Group) Group(handlers ...MessageHandler) *Group
func (*Group) OnCmd ¶
func (g *Group) OnCmd(cmd string, handlers ...MessageHandler)
type MessageBody ¶
type MessageBody struct { Cmd string `json:"cmd"` Seqno string `json:"seqno,omitempty"` Data json.RawMessage `json:"data,omitempty"` }
type MessageContext ¶
type MessageContext struct { Conn *websocket.Conn MessageType int Message []byte JsonBody *MessageBody Server *Server Error error // contains filtered or unexported fields }
func (*MessageContext) Abort ¶
func (c *MessageContext) Abort()
func (*MessageContext) AbortWithError ¶
func (c *MessageContext) AbortWithError(err error)
func (*MessageContext) Context ¶
func (c *MessageContext) Context() context.Context
func (*MessageContext) IsAborted ¶
func (c *MessageContext) IsAborted() bool
func (*MessageContext) Next ¶
func (c *MessageContext) Next()
func (*MessageContext) ShouldBindJson ¶
func (c *MessageContext) ShouldBindJson(v interface{}) error
func (*MessageContext) WithContext ¶
func (c *MessageContext) WithContext(ctx context.Context) *MessageContext
func (*MessageContext) WriteMessage ¶
func (c *MessageContext) WriteMessage(data []byte) error
type MessageHandler ¶
type MessageHandler func(ctx *MessageContext)
func Timeout ¶
func Timeout() MessageHandler
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Group ¶
func (s *Server) Group(handlers ...MessageHandler) *Group
func (*Server) OnCmd ¶
func (s *Server) OnCmd(cmd string, handlers ...MessageHandler)
func (*Server) OnConnect ¶
func (s *Server) OnConnect(handlers ...ConnHandler)
Click to show internal directories.
Click to hide internal directories.