Documentation ¶
Index ¶
- func ServeWs(hub *Hub, w http.ResponseWriter, r *http.Request)
- type Client
- type ClientCommand
- type Games
- type Hub
- type PersistenceEngine
- func (engine *PersistenceEngine) Close()
- func (engine *PersistenceEngine) Delete(key string)
- func (engine *PersistenceEngine) Get(key string) ([]byte, error)
- func (engine *PersistenceEngine) GetKeys(prefix string) ([]string, error)
- func (engine *PersistenceEngine) Incr(counterKey string) (int, error)
- func (engine *PersistenceEngine) Set(key string, value []byte, expiry int) error
- func (engine *PersistenceEngine) WaitForRedis()
- type Quizzes
- type Sessions
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 middleman between the websocket connection and the hub.
type ClientCommand ¶
type ClientCommand struct {
// contains filtered or unexported fields
}
func NewClientCommand ¶
func NewClientCommand(client uint64, message []byte) *ClientCommand
type Games ¶
type Games struct {
// contains filtered or unexported fields
}
func InitGames ¶
func InitGames(msghub messaging.MessageHub, engine *PersistenceEngine) *Games
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to the clients.
func NewHub ¶
func NewHub(msghub messaging.MessageHub, persistenceEngine *PersistenceEngine) *Hub
func (*Hub) ClosePersistenceEngine ¶
func (h *Hub) ClosePersistenceEngine()
func (*Hub) DeregisterClientID ¶
called by session reaper
type PersistenceEngine ¶
type PersistenceEngine struct {
// contains filtered or unexported fields
}
func InitRedis ¶
func InitRedis(redisHost, redisPassword string) *PersistenceEngine
func (*PersistenceEngine) Close ¶
func (engine *PersistenceEngine) Close()
func (*PersistenceEngine) Delete ¶
func (engine *PersistenceEngine) Delete(key string)
func (*PersistenceEngine) GetKeys ¶
func (engine *PersistenceEngine) GetKeys(prefix string) ([]string, error)
func (*PersistenceEngine) Incr ¶
func (engine *PersistenceEngine) Incr(counterKey string) (int, error)
func (*PersistenceEngine) Set ¶
func (engine *PersistenceEngine) Set(key string, value []byte, expiry int) error
func (*PersistenceEngine) WaitForRedis ¶
func (engine *PersistenceEngine) WaitForRedis()
wait for Redis to come up
type Quizzes ¶
type Quizzes struct {
// contains filtered or unexported fields
}
func InitQuizzes ¶
func InitQuizzes(msghub messaging.MessageHub, engine *PersistenceEngine) (*Quizzes, error)
type Sessions ¶
type Sessions struct {
// contains filtered or unexported fields
}
func InitSessions ¶
func InitSessions(msghub messaging.MessageHub, engine *PersistenceEngine, wsRegistry webSocketRegistry, auth *api.Auth, sessionTimeout int, reaperInterval int) *Sessions
func (*Sessions) RunSessionReaper ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.