proto

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: 14 Imported by: 0

Documentation

Overview

Package proto is a generated protocol buffer package.

It is generated from these files:

message.proto

It has these top-level messages:

ClientInfo
Message
JoinMessage
LeaveMessage
ControlMessage
AdminMessage

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidMessage means that you sent invalid message to Centrifugo.
	ErrInvalidMessage = errors.New("invalid message")
	// ErrMethodNotFound means that method sent in command does not exist.
	ErrMethodNotFound = errors.New("method not found")
	// ErrNamespaceNotFound means that namespace in channel name does not exist.
	ErrNamespaceNotFound = errors.New("namespace not found")
	// ErrInternalServerError means server error, if returned this is a signal that
	// something went wrong with Centrifugo itself.
	ErrInternalServerError = errors.New("internal server error")
	// ErrNotAvailable means that resource is not enabled.
	ErrNotAvailable = errors.New("not available")
	// ErrUnauthorized means unauthorized access.
	ErrUnauthorized = errors.New("unauthorized")
	// ErrClientClosed means that client connection already closed.
	ErrClientClosed = errors.New("client is closed")
	// ErrInvalidToken means that client sent invalid token.
	ErrInvalidToken = errors.New("invalid token")
	// ErrPermissionDenied means that access to resource not allowed.
	ErrPermissionDenied = errors.New("permission denied")
	// ErrAlreadySubscribed returned when client wants to subscribe on channel
	// it already subscribed to.
	ErrAlreadySubscribed = errors.New("already subscribed")
	// ErrLimitExceeded says that some sort of limit exceeded, server logs should give
	// more detailed information.
	ErrLimitExceeded = errors.New("limit exceeded")
	// ErrSendTimeout means that timeout occurred when sending message into connection.
	ErrSendTimeout = errors.New("send timeout")
)
View Source
var (
	ErrInvalidLengthMessage = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMessage   = fmt.Errorf("proto: integer overflow")
)

Functions

func EncodeJSONString

func EncodeJSONString(buf *bytebufferpool.ByteBuffer, s string, escapeHTML bool)

EncodeJSONString escapes string value when encoding it to JSON. From https://golang.org/src/encoding/json/encode.go

Types

type APIBroadcastResponse

type APIBroadcastResponse struct {
	Body interface{} `json:"body"` // TODO: interface{} for API protocol backwards compatibility.
	// contains filtered or unexported fields
}

func NewAPIBroadcastResponse

func NewAPIBroadcastResponse() *APIBroadcastResponse

func (*APIBroadcastResponse) SetErr

func (r *APIBroadcastResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*APIBroadcastResponse) SetUID

func (r *APIBroadcastResponse) SetUID(uid string)

type APIChannelsResponse

type APIChannelsResponse struct {
	Body ChannelsBody `json:"body"`
	// contains filtered or unexported fields
}

func NewAPIChannelsResponse

func NewAPIChannelsResponse(body ChannelsBody) *APIChannelsResponse

func (*APIChannelsResponse) SetErr

func (r *APIChannelsResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*APIChannelsResponse) SetUID

func (r *APIChannelsResponse) SetUID(uid string)

type APICommand

type APICommand struct {
	UID    string  `json:"uid"`
	Method string  `json:"method"`
	Params raw.Raw `json:"params"`
}

type APIDisconnectResponse

type APIDisconnectResponse struct {
	Body interface{} `json:"body"` // TODO: interface{} for API protocol backwards compatibility.
	// contains filtered or unexported fields
}

func NewAPIDisconnectResponse

func NewAPIDisconnectResponse() *APIDisconnectResponse

func (*APIDisconnectResponse) SetErr

func (r *APIDisconnectResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*APIDisconnectResponse) SetUID

func (r *APIDisconnectResponse) SetUID(uid string)

type APIHistoryResponse

type APIHistoryResponse struct {
	Body HistoryBody `json:"body"`
	// contains filtered or unexported fields
}

func NewAPIHistoryResponse

func NewAPIHistoryResponse(body HistoryBody) *APIHistoryResponse

func (*APIHistoryResponse) SetErr

func (r *APIHistoryResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*APIHistoryResponse) SetUID

func (r *APIHistoryResponse) SetUID(uid string)

type APINodeResponse

type APINodeResponse struct {
	Body NodeBody `json:"body"`
	// contains filtered or unexported fields
}

func NewAPINodeResponse

func NewAPINodeResponse(body NodeBody) *APINodeResponse

func (*APINodeResponse) SetErr

func (r *APINodeResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*APINodeResponse) SetUID

func (r *APINodeResponse) SetUID(uid string)

type APIPresenceResponse

type APIPresenceResponse struct {
	Body PresenceBody `json:"body"`
	// contains filtered or unexported fields
}

func NewAPIPresenceResponse

func NewAPIPresenceResponse(body PresenceBody) *APIPresenceResponse

func (*APIPresenceResponse) SetErr

func (r *APIPresenceResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*APIPresenceResponse) SetUID

func (r *APIPresenceResponse) SetUID(uid string)

type APIPublishResponse

type APIPublishResponse struct {
	Body interface{} `json:"body"` // TODO: interface{} for API protocol backwards compatibility.
	// contains filtered or unexported fields
}

func NewAPIPublishResponse

func NewAPIPublishResponse() *APIPublishResponse

func (*APIPublishResponse) SetErr

func (r *APIPublishResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*APIPublishResponse) SetUID

func (r *APIPublishResponse) SetUID(uid string)

type APIStatsResponse

type APIStatsResponse struct {
	Body StatsBody `json:"body"`
	// contains filtered or unexported fields
}

func NewAPIStatsResponse

func NewAPIStatsResponse(body StatsBody) *APIStatsResponse

func (*APIStatsResponse) SetErr

func (r *APIStatsResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*APIStatsResponse) SetUID

func (r *APIStatsResponse) SetUID(uid string)

type APIUnsubscribeResponse

type APIUnsubscribeResponse struct {
	Body interface{} `json:"body"` // TODO: interface{} for API protocol backwards compatibility.
	// contains filtered or unexported fields
}

func NewAPIUnsubscribeResponse

func NewAPIUnsubscribeResponse() *APIUnsubscribeResponse

func (*APIUnsubscribeResponse) SetErr

func (r *APIUnsubscribeResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*APIUnsubscribeResponse) SetUID

func (r *APIUnsubscribeResponse) SetUID(uid string)

type AdminConnectResponse

type AdminConnectResponse struct {
	Body bool `json:"body"`
	// contains filtered or unexported fields
}

func NewAdminConnectResponse

func NewAdminConnectResponse(body bool) *AdminConnectResponse

func (*AdminConnectResponse) SetErr

func (r *AdminConnectResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*AdminConnectResponse) SetUID

func (r *AdminConnectResponse) SetUID(uid string)

type AdminInfoBody

type AdminInfoBody struct {
	Data map[string]interface{} `json:"data"`
}

type AdminInfoResponse

type AdminInfoResponse struct {
	Body AdminInfoBody `json:"body"`
	// contains filtered or unexported fields
}

func NewAdminInfoResponse

func NewAdminInfoResponse(body AdminInfoBody) *AdminInfoResponse

func (*AdminInfoResponse) SetErr

func (r *AdminInfoResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*AdminInfoResponse) SetUID

func (r *AdminInfoResponse) SetUID(uid string)

type AdminMessage

type AdminMessage struct {
	UID    string                                                  `protobuf:"bytes,1,opt,name=UID,proto3" json:"uid"`
	Method string                                                  `protobuf:"bytes,2,opt,name=Method,proto3" json:"method"`
	Params github_com_centrifugal_centrifugo_libcentrifugo_raw.Raw `protobuf:"bytes,3,opt,name=Params,proto3,customtype=github.com/centrifugal/centrifugo/libcentrifugo/raw.Raw" json:"params"`
}

func NewAdminMessage

func NewAdminMessage(method string, params []byte) *AdminMessage

func NewPopulatedAdminMessage

func NewPopulatedAdminMessage(r randyMessage, easy bool) *AdminMessage

func (*AdminMessage) Descriptor

func (*AdminMessage) Descriptor() ([]byte, []int)

func (*AdminMessage) Equal

func (this *AdminMessage) Equal(that interface{}) bool

func (*AdminMessage) Marshal

func (m *AdminMessage) Marshal() (dAtA []byte, err error)

func (*AdminMessage) MarshalTo

func (m *AdminMessage) MarshalTo(dAtA []byte) (int, error)

func (*AdminMessage) ProtoMessage

func (*AdminMessage) ProtoMessage()

func (*AdminMessage) Reset

func (m *AdminMessage) Reset()

func (*AdminMessage) Size

func (m *AdminMessage) Size() (n int)

func (*AdminMessage) String

func (m *AdminMessage) String() string

func (*AdminMessage) Unmarshal

func (m *AdminMessage) Unmarshal(dAtA []byte) error

type AdminMessageResponse

type AdminMessageResponse struct {
	Body raw.Raw `json:"body"`
	// contains filtered or unexported fields
}

func NewAdminMessageResponse

func NewAdminMessageResponse(body raw.Raw) *AdminMessageResponse

func (*AdminMessageResponse) SetErr

func (r *AdminMessageResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*AdminMessageResponse) SetUID

func (r *AdminMessageResponse) SetUID(uid string)

type AdminPingResponse

type AdminPingResponse struct {
	Body string `json:"body"`
	// contains filtered or unexported fields
}

func NewAdminPingResponse

func NewAdminPingResponse(body string) *AdminPingResponse

func (*AdminPingResponse) SetErr

func (r *AdminPingResponse) SetErr(err ResponseError)

SetErr set an error message on the api response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*AdminPingResponse) SetUID

func (r *AdminPingResponse) SetUID(uid string)

type BroadcastAPICommand

type BroadcastAPICommand struct {
	Channels []string `json:"channels"`
	Data     raw.Raw  `json:"data"`
	Client   string   `json:"client"`
}

BroadcastApiCommand is used to publish messages into multiple channels.

type ChannelOptions

type ChannelOptions struct {
	// Watch determines if message published into channel will be also sent into admin channel.
	// Note that this option must be used carefully in channels with high rate of new messages
	// as admin client can not process all of those messages. Use this option for testing or for
	// channels with reasonable message rate.
	Watch bool `json:"watch"`

	// Publish determines if client can publish messages into channel directly. This allows to use
	// Centrifugo without backend. All messages go through Centrifugo and delivered to clients. But
	// in this case you lose everything your backend code could give - validation, persistence etc.
	// This option most useful for demos, testing real-time ideas.
	Publish bool `json:"publish"`

	// Anonymous determines is anonymous access (with empty user ID) allowed or not. In most
	// situations your application works with authorized users so every user has its own unique
	// id. But if you provide real-time features for public access you may need anauthorized
	// access to channels. Turn on this option and use empty string as user ID.
	Anonymous bool `json:"anonymous"`

	// Presence turns on(off) presence information for channels. Presense is a structure with
	// clients currently subscribed on channel.
	Presence bool `json:"presence"`

	// JoinLeave turns on(off) join/leave messages for channels. When client subscribes on channel
	// join message sent to all clients in this channel. When client leaves channel (unsubscribes)
	// leave message sent.
	JoinLeave bool `mapstructure:"join_leave" json:"join_leave"`

	// HistorySize determines max amount of history messages for channel, 0 means no history for channel.
	// Centrifugo history has auxiliary role – it can not replace your backend persistent storage.
	HistorySize int `mapstructure:"history_size" json:"history_size"`

	// HistoryLifetime determines time in seconds until expiration for history messages. As Centrifugo
	// keeps history in memory (in process memory or in Redis process memory) it's important to remove
	// old messages to prevent infinite memory grows.
	HistoryLifetime int `mapstructure:"history_lifetime" json:"history_lifetime"`

	// Recover enables recover mechanism for channels. This means that Centrifugo will
	// try to recover missed messages for resubscribing client. This option uses messages
	// from history and must be used with reasonable HistorySize and HistoryLifetime
	// configuration.
	Recover bool `json:"recover"`

	// HistoryDropInactive enables an optimization where history is only saved for channels that have at
	// least one active subscriber. This can give a huge memory saving, with only minor edgecases that are
	// different from without it as noted on https://github.com/centrifugal/centrifugo/issues/50.
	HistoryDropInactive bool `mapstructure:"history_drop_inactive" json:"history_drop_inactive"`
}

ChannelOptions represent channel specific configuration for namespace or project in a whole

type ChannelsBody

type ChannelsBody struct {
	Data []string `json:"data"`
}

ChannelsBody represents body of response in case of successful channels command.

type ClientCommand

type ClientCommand struct {
	UID    string  `json:"uid"`
	Method string  `json:"method"`
	Params raw.Raw `json:"params"`
}

func ClientCommandsFromJSON

func ClientCommandsFromJSON(msgBytes []byte) ([]ClientCommand, error)

type ClientConnectResponse

type ClientConnectResponse struct {
	Body ConnectBody `json:"body"`
	// contains filtered or unexported fields
}

func NewClientConnectResponse

func NewClientConnectResponse(body ConnectBody) *ClientConnectResponse

func (*ClientConnectResponse) SetErr

func (r *ClientConnectResponse) SetErr(err ResponseError)

Err set a client error on the client response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*ClientConnectResponse) SetUID

func (r *ClientConnectResponse) SetUID(uid string)

type ClientDisconnectResponse

type ClientDisconnectResponse struct {
	Body DisconnectBody `json:"body"`
	// contains filtered or unexported fields
}

func NewClientDisconnectResponse

func NewClientDisconnectResponse(body DisconnectBody) *ClientDisconnectResponse

func (*ClientDisconnectResponse) SetErr

func (r *ClientDisconnectResponse) SetErr(err ResponseError)

Err set a client error on the client response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*ClientDisconnectResponse) SetUID

func (r *ClientDisconnectResponse) SetUID(uid string)

type ClientHistoryResponse

type ClientHistoryResponse struct {
	Body HistoryBody `json:"body"`
	// contains filtered or unexported fields
}

func NewClientHistoryResponse

func NewClientHistoryResponse(body HistoryBody) *ClientHistoryResponse

func (*ClientHistoryResponse) SetErr

func (r *ClientHistoryResponse) SetErr(err ResponseError)

Err set a client error on the client response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*ClientHistoryResponse) SetUID

func (r *ClientHistoryResponse) SetUID(uid string)

type ClientInfo

type ClientInfo struct {
	User        string                                                  `protobuf:"bytes,1,opt,name=User,proto3" json:"user"`
	Client      string                                                  `protobuf:"bytes,2,opt,name=Client,proto3" json:"client"`
	DefaultInfo github_com_centrifugal_centrifugo_libcentrifugo_raw.Raw `` /* 143-byte string literal not displayed */
	ChannelInfo github_com_centrifugal_centrifugo_libcentrifugo_raw.Raw `` /* 143-byte string literal not displayed */
}

func NewClientInfo

func NewClientInfo(user string, client string, defaultInfo raw.Raw, channelInfo raw.Raw) *ClientInfo

func NewPopulatedClientInfo

func NewPopulatedClientInfo(r randyMessage, easy bool) *ClientInfo

func (*ClientInfo) Descriptor

func (*ClientInfo) Descriptor() ([]byte, []int)

func (*ClientInfo) Equal

func (this *ClientInfo) Equal(that interface{}) bool

func (*ClientInfo) Marshal

func (m *ClientInfo) Marshal() (dAtA []byte, err error)

func (*ClientInfo) MarshalTo

func (m *ClientInfo) MarshalTo(dAtA []byte) (int, error)

func (*ClientInfo) ProtoMessage

func (*ClientInfo) ProtoMessage()

func (*ClientInfo) Reset

func (m *ClientInfo) Reset()

func (*ClientInfo) Size

func (m *ClientInfo) Size() (n int)

func (*ClientInfo) String

func (m *ClientInfo) String() string

func (*ClientInfo) Unmarshal

func (m *ClientInfo) Unmarshal(dAtA []byte) error

type ClientJoinResponse

type ClientJoinResponse struct {
	Method string      `json:"method"`
	Body   JoinMessage `json:"body"`
}

func NewClientJoinMessage

func NewClientJoinMessage(msg *JoinMessage) *ClientJoinResponse

func (*ClientJoinResponse) Marshal

func (m *ClientJoinResponse) Marshal() ([]byte, error)

type ClientLeaveResponse

type ClientLeaveResponse struct {
	Method string       `json:"method"`
	Body   LeaveMessage `json:"body"`
}

func NewClientLeaveMessage

func NewClientLeaveMessage(msg *LeaveMessage) *ClientLeaveResponse

func (*ClientLeaveResponse) Marshal

func (m *ClientLeaveResponse) Marshal() ([]byte, error)

type ClientMessageResponse

type ClientMessageResponse struct {
	Method string  `json:"method"`
	Body   Message `json:"body"`
}

ClientMessageResponse can not have an error.

func NewClientMessage

func NewClientMessage(msg *Message) *ClientMessageResponse

NewClientMessage returns initialized client message response.

func (*ClientMessageResponse) Marshal

func (m *ClientMessageResponse) Marshal() ([]byte, error)

type ClientPingResponse

type ClientPingResponse struct {
	Body *PingBody `json:"body,omitempty"`
	// contains filtered or unexported fields
}

func NewClientPingResponse

func NewClientPingResponse(body *PingBody) *ClientPingResponse

func (*ClientPingResponse) SetErr

func (r *ClientPingResponse) SetErr(err ResponseError)

Err set a client error on the client response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*ClientPingResponse) SetUID

func (r *ClientPingResponse) SetUID(uid string)

type ClientPresenceResponse

type ClientPresenceResponse struct {
	Body PresenceBody `json:"body"`
	// contains filtered or unexported fields
}

func NewClientPresenceResponse

func NewClientPresenceResponse(body PresenceBody) *ClientPresenceResponse

func (*ClientPresenceResponse) SetErr

func (r *ClientPresenceResponse) SetErr(err ResponseError)

Err set a client error on the client response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*ClientPresenceResponse) SetUID

func (r *ClientPresenceResponse) SetUID(uid string)

type ClientPublishResponse

type ClientPublishResponse struct {
	Body PublishBody `json:"body"`
	// contains filtered or unexported fields
}

func NewClientPublishResponse

func NewClientPublishResponse(body PublishBody) *ClientPublishResponse

func (*ClientPublishResponse) SetErr

func (r *ClientPublishResponse) SetErr(err ResponseError)

Err set a client error on the client response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*ClientPublishResponse) SetUID

func (r *ClientPublishResponse) SetUID(uid string)

type ClientRefreshResponse

type ClientRefreshResponse struct {
	Body ConnectBody `json:"body"`
	// contains filtered or unexported fields
}

func NewClientRefreshResponse

func NewClientRefreshResponse(body ConnectBody) *ClientRefreshResponse

func (*ClientRefreshResponse) SetErr

func (r *ClientRefreshResponse) SetErr(err ResponseError)

Err set a client error on the client response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*ClientRefreshResponse) SetUID

func (r *ClientRefreshResponse) SetUID(uid string)

type ClientSubscribeResponse

type ClientSubscribeResponse struct {
	Body SubscribeBody `json:"body"`
	// contains filtered or unexported fields
}

func NewClientSubscribeResponse

func NewClientSubscribeResponse(body SubscribeBody) *ClientSubscribeResponse

func (*ClientSubscribeResponse) SetErr

func (r *ClientSubscribeResponse) SetErr(err ResponseError)

Err set a client error on the client response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*ClientSubscribeResponse) SetUID

func (r *ClientSubscribeResponse) SetUID(uid string)

type ClientUnsubscribeResponse

type ClientUnsubscribeResponse struct {
	Body UnsubscribeBody `json:"body"`
	// contains filtered or unexported fields
}

func NewClientUnsubscribeResponse

func NewClientUnsubscribeResponse(body UnsubscribeBody) *ClientUnsubscribeResponse

func (*ClientUnsubscribeResponse) SetErr

func (r *ClientUnsubscribeResponse) SetErr(err ResponseError)

Err set a client error on the client response and updates the 'err' field in the response. If an error has already been set it will be kept.

func (*ClientUnsubscribeResponse) SetUID

func (r *ClientUnsubscribeResponse) SetUID(uid string)

type ConnectAdminCommand

type ConnectAdminCommand struct {
	Token string `json:"token"`
	Watch bool   `json:"watch"`
}

ConnectAdminCommand required to authorize admin connection and provide connection options.

type ConnectBody

type ConnectBody struct {
	Version string `json:"version"`
	Client  string `json:"client"`
	Expires bool   `json:"expires"`
	Expired bool   `json:"expired"`
	TTL     int64  `json:"ttl"`
}

ConnectBody represents body of response in case of successful connect command.

type ConnectClientCommand

type ConnectClientCommand struct {
	User      string `json:"user"`
	Timestamp string `json:"timestamp"`
	Info      string `json:"info"`
	Token     string `json:"token"`
	Ping      bool   `json:"ping"`
}

ConnectClientCommand is a command to authorize connection - it contains user ID in web application, additional connection information as JSON string, timestamp with unix seconds on moment when connect parameters generated and HMAC token to prove correctness of all those parameters.

type ControlMessage

type ControlMessage struct {
	// UID in case of controlCommand is a unique node ID which originally published
	// this control command.
	UID    string                                                  `protobuf:"bytes,1,opt,name=UID,proto3" json:"uid"`
	Method string                                                  `protobuf:"bytes,2,opt,name=Method,proto3" json:"method"`
	Params github_com_centrifugal_centrifugo_libcentrifugo_raw.Raw `protobuf:"bytes,3,opt,name=Params,proto3,customtype=github.com/centrifugal/centrifugo/libcentrifugo/raw.Raw" json:"params"`
}

func NewControlMessage

func NewControlMessage(uid string, method string, params []byte) *ControlMessage

func NewPopulatedControlMessage

func NewPopulatedControlMessage(r randyMessage, easy bool) *ControlMessage

func (*ControlMessage) Descriptor

func (*ControlMessage) Descriptor() ([]byte, []int)

func (*ControlMessage) Equal

func (this *ControlMessage) Equal(that interface{}) bool

func (*ControlMessage) Marshal

func (m *ControlMessage) Marshal() (dAtA []byte, err error)

func (*ControlMessage) MarshalTo

func (m *ControlMessage) MarshalTo(dAtA []byte) (int, error)

func (*ControlMessage) ProtoMessage

func (*ControlMessage) ProtoMessage()

func (*ControlMessage) Reset

func (m *ControlMessage) Reset()

func (*ControlMessage) Size

func (m *ControlMessage) Size() (n int)

func (*ControlMessage) String

func (m *ControlMessage) String() string

func (*ControlMessage) Unmarshal

func (m *ControlMessage) Unmarshal(dAtA []byte) error

type DisconnectAPICommand

type DisconnectAPICommand struct {
	User string `json:"user"`
}

DisconnectApiCommand is used to disconnect user.

type DisconnectBody

type DisconnectBody struct {
	Reason    string `json:"reason"`
	Reconnect bool   `json:"reconnect"`
}

DisconnectBody represents body of disconnect response when we want to tell client to disconnect. Optionally we can give client an advice to continue reconnecting after receiving this.

type DisconnectControlCommand

type DisconnectControlCommand struct {
	User string `json:"user"`
}

DisconnectControlCommand required to disconnect user from all nodes.

type ErrorAdvice

type ErrorAdvice string
const (
	ErrorAdviceNone  ErrorAdvice = ""
	ErrorAdviceFix   ErrorAdvice = "fix"
	ErrorAdviceRetry ErrorAdvice = "retry"
)

type HistoryAPICommand

type HistoryAPICommand struct {
	Channel string `json:"channel"`
}

HistoryApiCommand is used to get history information for channel.

type HistoryBody

type HistoryBody struct {
	Channel string    `json:"channel"`
	Data    []Message `json:"data"`
}

HistoryBody represents body of response in case of successful history command.

type HistoryClientCommand

type HistoryClientCommand struct {
	Channel string `json:"channel"`
}

HistoryClientCommand is used to get history information for channel.

type JoinMessage

type JoinMessage struct {
	Channel string     `protobuf:"bytes,1,opt,name=Channel,proto3" json:"channel"`
	Data    ClientInfo `protobuf:"bytes,2,opt,name=Data" json:"data"`
}

func NewJoinMessage

func NewJoinMessage(ch string, info ClientInfo) *JoinMessage

func NewPopulatedJoinMessage

func NewPopulatedJoinMessage(r randyMessage, easy bool) *JoinMessage

func (*JoinMessage) Descriptor

func (*JoinMessage) Descriptor() ([]byte, []int)

func (*JoinMessage) Equal

func (this *JoinMessage) Equal(that interface{}) bool

func (*JoinMessage) GetData

func (m *JoinMessage) GetData() ClientInfo

func (*JoinMessage) Marshal

func (m *JoinMessage) Marshal() (dAtA []byte, err error)

func (*JoinMessage) MarshalTo

func (m *JoinMessage) MarshalTo(dAtA []byte) (int, error)

func (*JoinMessage) ProtoMessage

func (*JoinMessage) ProtoMessage()

func (*JoinMessage) Reset

func (m *JoinMessage) Reset()

func (*JoinMessage) Size

func (m *JoinMessage) Size() (n int)

func (*JoinMessage) String

func (m *JoinMessage) String() string

func (*JoinMessage) Unmarshal

func (m *JoinMessage) Unmarshal(dAtA []byte) error

type LeaveMessage

type LeaveMessage struct {
	Channel string     `protobuf:"bytes,1,opt,name=Channel,proto3" json:"channel"`
	Data    ClientInfo `protobuf:"bytes,2,opt,name=Data" json:"data"`
}

func NewLeaveMessage

func NewLeaveMessage(ch string, info ClientInfo) *LeaveMessage

func NewPopulatedLeaveMessage

func NewPopulatedLeaveMessage(r randyMessage, easy bool) *LeaveMessage

func (*LeaveMessage) Descriptor

func (*LeaveMessage) Descriptor() ([]byte, []int)

func (*LeaveMessage) Equal

func (this *LeaveMessage) Equal(that interface{}) bool

func (*LeaveMessage) GetData

func (m *LeaveMessage) GetData() ClientInfo

func (*LeaveMessage) Marshal

func (m *LeaveMessage) Marshal() (dAtA []byte, err error)

func (*LeaveMessage) MarshalTo

func (m *LeaveMessage) MarshalTo(dAtA []byte) (int, error)

func (*LeaveMessage) ProtoMessage

func (*LeaveMessage) ProtoMessage()

func (*LeaveMessage) Reset

func (m *LeaveMessage) Reset()

func (*LeaveMessage) Size

func (m *LeaveMessage) Size() (n int)

func (*LeaveMessage) String

func (m *LeaveMessage) String() string

func (*LeaveMessage) Unmarshal

func (m *LeaveMessage) Unmarshal(dAtA []byte) error

type Message

type Message struct {
	UID       string                                                  `protobuf:"bytes,1,opt,name=UID,proto3" json:"uid"`
	Timestamp string                                                  `protobuf:"bytes,2,opt,name=Timestamp,proto3" json:"timestamp"`
	Channel   string                                                  `protobuf:"bytes,3,opt,name=Channel,proto3" json:"channel"`
	Data      github_com_centrifugal_centrifugo_libcentrifugo_raw.Raw `protobuf:"bytes,4,opt,name=Data,proto3,customtype=github.com/centrifugal/centrifugo/libcentrifugo/raw.Raw" json:"data"`
	Client    string                                                  `protobuf:"bytes,5,opt,name=Client,proto3" json:"client,omitempty"`
	Info      *ClientInfo                                             `protobuf:"bytes,6,opt,name=Info" json:"info,omitempty"`
}

func NewMessage

func NewMessage(ch string, data []byte, client string, info *ClientInfo) *Message

func NewPopulatedMessage

func NewPopulatedMessage(r randyMessage, easy bool) *Message

func (*Message) Descriptor

func (*Message) Descriptor() ([]byte, []int)

func (*Message) Equal

func (this *Message) Equal(that interface{}) bool

func (*Message) GetInfo

func (m *Message) GetInfo() *ClientInfo

func (*Message) Marshal

func (m *Message) Marshal() (dAtA []byte, err error)

func (*Message) MarshalTo

func (m *Message) MarshalTo(dAtA []byte) (int, error)

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) Size

func (m *Message) Size() (n int)

func (*Message) String

func (m *Message) String() string

func (*Message) Unmarshal

func (m *Message) Unmarshal(dAtA []byte) error

type MultiAPIResponse

type MultiAPIResponse []Response

MultiAPIResponse is a slice of API responses returned as a result for slice of commands received by API in execution order - from first executed to last one.

type MultiClientResponse

type MultiClientResponse []Response

MultiClientResponse is a slice of responses in execution order - from first executed to last one

type NodeBody

type NodeBody struct {
	Data NodeInfo `json:"data"`
}

NodeBody represents body of response in case of successful node command.

type NodeInfo

type NodeInfo struct {
	UID     string           `json:"uid"`
	Name    string           `json:"name"`
	Started int64            `json:"started_at"`
	Metrics map[string]int64 `json:"metrics"`
	// contains filtered or unexported fields
}

NodeInfo contains information and statistics about Centrifugo node.

type PingAdminCommand

type PingAdminCommand struct {
	Data string `json:"data"`
}

PingAdminCommand is used to ping server.

type PingBody

type PingBody struct {
	Data string `json:"data,omitempty"`
}

PingBody represents body of response in case of successful ping command.

type PingClientCommand

type PingClientCommand struct {
	Data string `json:"data"`
}

PingClientCommand is used to ping server.

type PingControlCommand

type PingControlCommand struct {
	Info NodeInfo `json:"info"`
}

PingControlCommand allows nodes to know about each other - node sends this control command periodically.

type PresenceAPICommand

type PresenceAPICommand struct {
	Channel string `json:"channel"`
}

PresenceApiCommand is used to get presence (actual channel subscriptions) information for channel.

type PresenceBody

type PresenceBody struct {
	Channel string                `json:"channel"`
	Data    map[string]ClientInfo `json:"data"`
}

PresenceBody represents body of response in case of successful presence command.

type PresenceClientCommand

type PresenceClientCommand struct {
	Channel string `json:"channel"`
}

PresenceClientCommand is used to get presence (actual channel subscriptions). information for channel

type PublishAPICommand

type PublishAPICommand struct {
	Channel string  `json:"channel"`
	Client  string  `json:"client"`
	Data    raw.Raw `json:"data"`
}

PublishApiCommand is used to publish messages into channel.

type PublishBody

type PublishBody struct {
	Channel string `json:"channel"`
	Status  bool   `json:"status"`
}

PublishBody represents body of response in case of successful publish command.

type PublishClientCommand

type PublishClientCommand struct {
	Channel string  `json:"channel"`
	Data    raw.Raw `json:"data"`
}

PublishClientCommand is used to publish messages into channel.

type RefreshClientCommand

type RefreshClientCommand struct {
	User      string `json:"user"`
	Timestamp string `json:"timestamp"`
	Info      string `json:"info"`
	Token     string `json:"token"`
}

RefreshClientCommand is used to prolong connection lifetime when connection check mechanism is enabled. It can only be sent by client after successfull connect.

type Response

type Response interface {
	SetErr(err ResponseError)
	SetUID(uid string)
}

type ResponseError

type ResponseError struct {
	Err    error       `json:"-"`
	Advice ErrorAdvice `json:"advice,omitempty"`
}

type ServerStats

type ServerStats struct {
	Nodes           []NodeInfo `json:"nodes"`
	MetricsInterval int64      `json:"metrics_interval"`
}

ServerStats contains state and metrics information from running Centrifugo nodes.

type StatsBody

type StatsBody struct {
	Data ServerStats `json:"data"`
}

StatsBody represents body of response in case of successful stats command.

type SubscribeBody

type SubscribeBody struct {
	Channel   string    `json:"channel"`
	Status    bool      `json:"status"`
	Last      string    `json:"last"`
	Messages  []Message `json:"messages"`
	Recovered bool      `json:"recovered"`
}

SubscribeBody represents body of response in case of successful subscribe command.

type SubscribeClientCommand

type SubscribeClientCommand struct {
	Channel string `json:"channel"`
	Client  string `json:"client"`
	Last    string `json:"last"`
	Recover bool   `json:"recover"`
	Info    string `json:"info"`
	Sign    string `json:"sign"`
}

SubscribeClientCommand is used to subscribe on channel. It can only be sent by client after successfull connect. It also can have Client, Info and Sign properties when channel is private.

type UnsubscribeAPICommand

type UnsubscribeAPICommand struct {
	Channel string `json:"channel"`
	User    string `json:"user"`
}

UnsubscribeApiCommand is used to unsubscribe user from channel.

type UnsubscribeBody

type UnsubscribeBody struct {
	Channel string `json:"channel"`
	Status  bool   `json:"status"`
}

UnsubscribeBody represents body of response in case of successful unsubscribe command.

type UnsubscribeClientCommand

type UnsubscribeClientCommand struct {
	Channel string `json:"channel"`
}

UnsubscribeClientCommand is used to unsubscribe from channel.

type UnsubscribeControlCommand

type UnsubscribeControlCommand struct {
	Channel string `json:"channel"`
	User    string `json:"user"`
}

UnsubscribeControlCommand required when node received unsubscribe API command – node unsubscribes user from channel and then send this control command so other nodes could unsubscribe user too.

Jump to

Keyboard shortcuts

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