apiv1

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APICmd

func APICmd(n *node.Node, cmd proto.APICommand) (proto.Response, error)

APICmd builds API command and dispatches it into correct handler method.

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

func BroadcastCmd(n *node.Node, cmd proto.BroadcastAPICommand) (proto.Response, error)

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

func ChannelsCmd(n *node.Node) (proto.Response, error)

ChannelsCmd returns active channels.

func DisconnectCmd

func DisconnectCmd(n *node.Node, cmd proto.DisconnectAPICommand) (proto.Response, error)

DisconnectCmd disconnects user by its ID and sends disconnect control message to other nodes so they could also disconnect this user.

func HistoryCmd

func HistoryCmd(n *node.Node, cmd proto.HistoryAPICommand) (proto.Response, error)

HistoryCmd returns response with history information for channel.

func NodeCmd

func NodeCmd(n *node.Node) (proto.Response, error)

NodeCmd returns simple counter metrics which update in real time for the current node only.

func PresenceCmd

func PresenceCmd(n *node.Node, cmd proto.PresenceAPICommand) (proto.Response, error)

PresenceCmd returns response with presense information for channel.

func ProcessAPIData

func ProcessAPIData(n *node.Node, data []byte) ([]byte, error)

ProcessAPIData is a helper method to extract commands from []byte data in APIv1 format, run commands and return JSON encoded response.

func PublishCmd

func PublishCmd(n *node.Node, cmd proto.PublishAPICommand) (proto.Response, error)

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 StatsCmd

func StatsCmd(n *node.Node) (proto.Response, error)

StatsCmd returns active node stats.

func UnsubcribeCmd

func UnsubcribeCmd(n *node.Node, cmd proto.UnsubscribeAPICommand) (proto.Response, error)

UnsubscribeCmd unsubscribes project's user from channel and sends unsubscribe control message to other nodes.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL