Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a middleperson between the websocket connection and the hub.
type ClientReport ¶
type ClientReport struct { CanRead bool `json:"can_read"` CanWrite bool `json:"can_write"` ConnectedAt string `json:"connected_at"` ExpiresAt string `json:"expires_at"` RemoteAddr string `json:"remote_address"` Scopes []string `json:"scopes"` Statistics ReportStats `json:"statistcs"` Topic string `json:"topic"` UserAgent string `json:"user_agent"` }
ClientReport represents statistics on a client, and omits non-serialisable internal references
type Config ¶
type Config struct { // Audience must match the host in token Audience string // BufferSize is the channel buffer size for clients BufferSize int64 // connection type represents the parent path in the routing // This is set to "connect" by the API but can be overridden // so we can keep using test code written when this was called shellbar ConnectionType string // ExchangeCode swaps a code for the associated Token CodeStore *ttlcode.CodeStore // Listen is the listening port Listen int // Secret is used to validating statsTokens Secret string //StatsEvery controls how often to send stats reports StatsEvery time.Duration // contains filtered or unexported fields }
Config represents the configuration of a shellbar
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig returns a pointer to a new, default, Config
func (*Config) WithAudience ¶
WithAudience sets the audience in the Config
func (*Config) WithCodeStoreTTL ¶
WithCodeStoreTTL sets the TTL of the codestore
func (*Config) WithListen ¶
WithListen sets the listening port in the Config
type ConnectionAction ¶ added in v0.3.0
type ConnectionAction struct { Action string `json:"action"` URI string `json:"uri"` UUID string `json:"uuid"` }
ConnectionAction represents an action happening on a connection
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to the clients.
type ReportStats ¶
type ReportStats struct {
Last string `json:"last"`
}
ReportStats represents statistics to be reported on a connection
type RxTx ¶
type RxTx struct { Tx ReportStats `json:"tx"` Rx ReportStats `json:"rx"` }
RxTx represents statistics for both receive and transmit
type StatsCommand ¶
type StatsCommand struct {
Command string `json:"cmd"`
}
StatsCommand represents a command relating to collection of statistics