Documentation
¶
Index ¶
Constants ¶
View Source
const ( CmdSend = ">" CmdReceive = "+" CmdCancel = "-" )
Valid command names
View Source
const ( SUCCESS_CONNECTED = "connected" SUCCESS_SEND = "send" SUCCESS_FETCH_START = "fetch-start" SUCCESS_FETCH_END = "fetch-end" SUCCESS_SUBSCRIBED_TO = "subscribed-to" SUCCESS_CANCELED = "canceled" ERROR_SUBSCRIBED_TO = "error-subscribed-to" ERROR_BAD_REQUEST = "error-bad-request" ERROR_INTERNAL_SERVER = "error-server-internal" )
Valid constants for the NotificationMessage.Name
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode decodes a message, sent from the server to the client. The decoded messages can have one of the types: *Message or *NotificationMessage
func PanicLogger ¶
func PanicLogger()
Types ¶
type Cmd ¶
type Cmd struct { // The name of the command Name string // The argument line, following the commandName Arg string // The header line, if the command has one HeaderJSON string // The command payload, if the command has such Body []byte }
Cmd is a representation of a command, which the client sends to the server
type Message ¶
type Message struct { // The sequenceId of the message, which is given by the // server an is strictly monotonically increasing at least within a root topic. ID uint64 // The topic path Path Path // The user id of the message sender UserID string // The id of the sending application ApplicationID string // Filters applied to this message. The message will be sent only to the // routes that match the filters Filters map[string]string // The time of publishing, as Unix Timestamp date Time int64 // The header line of the message (optional). If set, then it has to be a valid JSON object structure. HeaderJSON string // The message payload Body []byte // Used in cluster mode to identify a guble node NodeID uint8 }
Message is a struct that represents a message in the guble protocol, as the server sends it to the client.
func ParseMessage ¶
func (*Message) BodyAsString ¶
type MessageDeliveryCallback ¶
type MessageDeliveryCallback func(*Message)
type NotificationMessage ¶
type NotificationMessage struct { // The name of the message Name string // The argument line, following the messageName Arg string // The optional json data supplied with the message Json string // Flag which indicates, if the notification is an error IsError bool }
NotificationMessage is a representation of a status messages or error message, sent from the server
func (*NotificationMessage) Bytes ¶
func (msg *NotificationMessage) Bytes() []byte
Bytes serializes the notification message into a byte slice
Click to show internal directories.
Click to hide internal directories.