Documentation ¶
Index ¶
Constants ¶
View Source
const ( AuthTokenKey = "token" AuthTokenValue = "authorized" )
View Source
const (
VERSION = "0.1.1"
)
Variables ¶
View Source
var ( ErrInvalidClientMessage = errors.New("invalid client message") ErrInvalidApiMessage = errors.New("invalid API message") ErrInvalidControlMessage = errors.New("invalid control message") ErrInvalidAdminMessage = errors.New("invalid admin message") ErrInvalidToken = errors.New("invalid token") ErrMethodNotFound = errors.New("method not found") ErrPermissionDenied = errors.New("permission denied") ErrProjectNotFound = errors.New("project not found") ErrNamespaceNotFound = errors.New("namespace not found") ErrInternalServerError = errors.New("internal server error") ErrLimitExceeded = errors.New("limit exceeded") ErrNotAvailable = errors.New("not available") ErrConnectionExpired = errors.New("connection expired") )
Functions ¶
Types ¶
type ChannelOptions ¶
type ChannelOptions struct { // Watch determines if message published into channel will be sent into admin channel Watch bool `json:"watch"` // Publish determines if client can publish messages into channel directly Publish bool `json:"publish"` // Anonymous determines is anonymous access (with empty user ID) allowed or not Anonymous bool `json:"anonymous"` // Presence turns on(off) presence information for channels Presence bool `json:"presence"` // HistorySize determines max amount of history messages for channel, 0 means no history for channel HistorySize int64 `mapstructure:"history_size" json:"history_size"` // HistoryLifetime determines time in seconds until expiration for history messages HistoryLifetime int64 `mapstructure:"history_lifetime" json:"history_lifetime"` // JoinLeave turns on(off) join/leave messages for channels JoinLeave bool `mapstructure:"join_leave" json:"join_leave"` }
ChannelOptions represent channel specific configuration for namespace or project in a whole
type ClientInfo ¶ added in v0.1.1
type ClientInfo struct { User UserID `json:"user"` Client ConnID `json:"client"` DefaultInfo *json.RawMessage `json:"default_info"` ChannelInfo *json.RawMessage `json:"channel_info"` }
ClientInfo contains information about client to use in message meta information, presence information, join/leave events etc.
type Message ¶ added in v0.1.1
type Message struct { Uid string `json:"uid"` Timestamp string `json:"timestamp"` Info *ClientInfo `json:"info"` Channel Channel `json:"channel"` Data *json.RawMessage `json:"data"` }
Message represents client message
type NamespaceKey ¶ added in v0.1.1
type NamespaceKey string // Namespace ID
type ProjectKey ¶ added in v0.1.1
type ProjectKey string // Project ID
Source Files ¶
Click to show internal directories.
Click to hide internal directories.