Documentation ¶
Index ¶
- type API
- type APIConfig
- type Action
- type Client
- func (client *Client) Conn() *websocket.Conn
- func (client *Client) ID() string
- func (client *Client) Ping(writeWait time.Duration) error
- func (client *Client) Send(message []byte) error
- func (client *Client) SendJSON(message interface{}) error
- func (client *Client) SetMsgHandlers(handler func(c *Client, msg []byte), onError func(c *Client))
- type MsgWSResponse
- type MsgWsRequest
- type Params
- type PubSub
- func (ps *PubSub) AddClient(c *Client) *PubSub
- func (ps *PubSub) GetClientSubs(topic string, client *Client) []*Subscription
- func (ps *PubSub) Publish(topic string, msg []byte)
- func (ps *PubSub) PublishJSON(topic string, data interface{})
- func (ps *PubSub) PublishPing(writeWait time.Duration)
- func (ps *PubSub) RemoveClient(client *Client) *PubSub
- func (ps *PubSub) Subscribe(client *Client, topic string) error
- func (ps *PubSub) Unsubscribe(client *Client, topic string) *PubSub
- type Resolver
- type Response
- type Rest
- type Subscription
- type Websocket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { HandlerREST func(w rest.ResponseWriter, r *rest.Request) HandlerWS func(c *Client, r *MsgWsRequest) // contains filtered or unexported fields }
type MsgWSResponse ¶
type MsgWSResponse struct { Action string `json:"action"` ReqID string `json:"reqid"` Result bool `json:"result"` Message string `json:"message"` Data interface{} `json:"data"` }
func NewErrorResponse ¶
func NewErrorResponse(action string, message string) MsgWSResponse
func NewSuccessResponse ¶
func NewSuccessResponse(action string, message string, data interface{}) MsgWSResponse
type MsgWsRequest ¶
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
func (*PubSub) GetClientSubs ¶
func (ps *PubSub) GetClientSubs(topic string, client *Client) []*Subscription
func (*PubSub) PublishJSON ¶
func (*PubSub) PublishPing ¶
func (*PubSub) RemoveClient ¶
type Resolver ¶
func NewResolver ¶
func (*Resolver) GetRequest ¶
func (*Resolver) PostRequest ¶
func (*Resolver) SetTimeout ¶
type Subscription ¶
type Subscription struct {
// contains filtered or unexported fields
}
type Websocket ¶
type Websocket struct { Pubsub *PubSub // contains filtered or unexported fields }
func NewWebsocket ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.