libcentrifugo

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2015 License: MIT Imports: 31 Imported by: 0

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")
	ErrUnauthorized          = errors.New("unauthorized")
	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

func Main

func Main()

Types

type Channel added in v0.1.1

type Channel string // Channel

type ChannelID added in v0.1.1

type ChannelID string // Channel ID

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 ConnID added in v0.1.1

type ConnID string // Connection ID

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

type UserID added in v0.1.1

type UserID string // User ID

Directories

Path Synopsis
This is an adapted code from Steve Francia's jWalterWeatherman library - see https://github.com/spf13/jWalterWeatherman
This is an adapted code from Steve Francia's jWalterWeatherman library - see https://github.com/spf13/jWalterWeatherman

Jump to

Keyboard shortcuts

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