Documentation ¶
Index ¶
- func APICmd(n *node.Node, cmd proto.APICommand) (proto.Response, error)
- func APICommandFromJSON(msg []byte) (proto.APICommand, error)
- func APICommandsFromJSON(msg []byte) ([]proto.APICommand, error)
- func BroadcastCmd(n *node.Node, cmd proto.BroadcastAPICommand) (proto.Response, error)
- func BroadcastCmdAsync(n *node.Node, cmd proto.BroadcastAPICommand) <-chan error
- func ChannelsCmd(n *node.Node) (proto.Response, error)
- func DisconnectCmd(n *node.Node, cmd proto.DisconnectAPICommand) (proto.Response, error)
- func HistoryCmd(n *node.Node, cmd proto.HistoryAPICommand) (proto.Response, error)
- func NodeCmd(n *node.Node) (proto.Response, error)
- func PresenceCmd(n *node.Node, cmd proto.PresenceAPICommand) (proto.Response, error)
- func ProcessAPIData(n *node.Node, data []byte) ([]byte, error)
- func PublishCmd(n *node.Node, cmd proto.PublishAPICommand) (proto.Response, error)
- func PublishCmdAsync(n *node.Node, cmd proto.PublishAPICommand) <-chan error
- func StatsCmd(n *node.Node) (proto.Response, error)
- func UnsubcribeCmd(n *node.Node, cmd proto.UnsubscribeAPICommand) (proto.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APICommandFromJSON ¶
func APICommandFromJSON(msg []byte) (proto.APICommand, error)
Try to extract single APICommand encoded as JSON.
func APICommandsFromJSON ¶
func APICommandsFromJSON(msg []byte) ([]proto.APICommand, error)
Try to extract slice of APICommand encoded as JSON. This function understands both single object and array of commands JSON looking at first byte of msg.
func BroadcastCmd ¶
BroadcastCmd publishes data into multiple channels.
func BroadcastCmdAsync ¶
func BroadcastCmdAsync(n *node.Node, cmd proto.BroadcastAPICommand) <-chan error
BroadcastCmdAsync publishes data into multiple channels without waiting for response.
func ChannelsCmd ¶
ChannelsCmd returns active channels.
func DisconnectCmd ¶
DisconnectCmd disconnects user by its ID and sends disconnect control message to other nodes so they could also disconnect this user.
func HistoryCmd ¶
HistoryCmd returns response with history information for channel.
func NodeCmd ¶
NodeCmd returns simple counter metrics which update in real time for the current node only.
func PresenceCmd ¶
PresenceCmd returns response with presense information for channel.
func ProcessAPIData ¶
ProcessAPIData is a helper method to extract commands from []byte data in APIv1 format, run commands and return JSON encoded response.
func PublishCmd ¶
PublishCmd publishes data into channel.
func PublishCmdAsync ¶
func PublishCmdAsync(n *node.Node, cmd proto.PublishAPICommand) <-chan error
PublishCmdAsync publishes data into channel without waiting for response.
func UnsubcribeCmd ¶
UnsubscribeCmd unsubscribes project's user from channel and sends unsubscribe control message to other nodes.
Types ¶
This section is empty.