Documentation ¶
Overview ¶
Package sockets encapsulates all of the Websocket communication. It's part of the framework/drivers layer.
Index ¶
Constants ¶
const ConnPollPeriod = 60 * time.Second
Variables ¶
var AllowedOrigins = []string{}
Functions ¶
Types ¶
type ConnMessage ¶
type ConnMessage struct {
// contains filtered or unexported fields
}
A ConnMessage is a message that just gets sent to a single socket 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 PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
PubSub encapsulates the various subscriptions to the different channels. The `liwords` package should have a very similar structure.
type Realm ¶
type Realm string
A Realm is basically a set of clients. It can be thought of as a game room, or perhaps a lobby.
const LobbyRealm Realm = "lobby"
const NullRealm Realm = ""
type RealmMessage ¶
type RealmMessage struct {
// contains filtered or unexported fields
}
A RealmMessage is a message that should be sent to a socket Realm.
type UserMessage ¶
type UserMessage struct {
// contains filtered or unexported fields
}
A UserMessage is a message that should be sent to a user (across all of the sockets that they are connected to, unless the channel says otherwise).