Documentation ¶
Index ¶
- Constants
- type APIConfig
- type AdminConfig
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect() error
- func (c *Client) ErrorCh() <-chan error
- func (c *Client) ReceiveCh() <-chan ClientMessage
- func (c *Client) Register(clientID string) (string, error)
- func (c *Client) Send(msg ClientMessage) error
- func (c *Client) Unregister(clientID string) error
- type ClientConfig
- type ClientMessage
- type Config
- type Service
- type StoreConfig
Constants ¶
View Source
const ( ClientMessageJoin = "join" ClientMessageLeave = "leave" ClientMessageRTC = "rtc" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIConfig ¶
type APIConfig struct { HTTP api.Config `toml:"http"` Admin AdminConfig `toml:"admin"` }
type AdminConfig ¶ added in v0.2.0
type AdminConfig struct { // Whether or not to enable admin API access. Enable bool `toml:"enable"` // The secret key used to authenticate admin requests. SecretKey string `toml:"secret_key"` }
func (AdminConfig) IsValid ¶ added in v0.2.0
func (c AdminConfig) IsValid() error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(cfg ClientConfig) (*Client, error)
func (*Client) ReceiveCh ¶
func (c *Client) ReceiveCh() <-chan ClientMessage
func (*Client) Send ¶
func (c *Client) Send(msg ClientMessage) error
func (*Client) Unregister ¶
type ClientConfig ¶
type ClientConfig struct { ClientID string AuthKey string URL string // contains filtered or unexported fields }
func (*ClientConfig) Parse ¶
func (c *ClientConfig) Parse() error
type ClientMessage ¶
type ClientMessage struct { Type string `msgpack:"type"` Data interface{} `msgpack:"data,omitempty"` }
func NewClientMessage ¶
func NewClientMessage(msgType string, data interface{}) *ClientMessage
func (*ClientMessage) DecodeMsgpack ¶
func (cm *ClientMessage) DecodeMsgpack(dec *msgpack.Decoder) error
func (*ClientMessage) EncodeMsgpack ¶
func (cm *ClientMessage) EncodeMsgpack(enc *msgpack.Encoder) error
func (*ClientMessage) Pack ¶
func (cm *ClientMessage) Pack() ([]byte, error)
func (*ClientMessage) Unpack ¶
func (cm *ClientMessage) Unpack(data []byte) error
type Config ¶
type Config struct { API APIConfig RTC rtc.ServerConfig Store StoreConfig }
type StoreConfig ¶
type StoreConfig struct {
DataSource string `toml:"data_source"`
}
func (StoreConfig) IsValid ¶
func (c StoreConfig) IsValid() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.