Documentation
¶
Overview ¶
Package server runs the http server with allows users to open websockets to play the game
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // AppName is the display name of the application AppName string // Port is the port number to run the server on Port string // Log is used to log errors and other information Log *log.Logger // Tokenizer is used to generate and parse session tokens Tokenizer Tokenizer // UserDao is used to track different users UserDao *db.UserDao // LobbyCfg is used to create a game lobby LobbyCfg lobby.Config // StopDur is the maximum duration the server should take to shutdown gracefully StopDur time.Duration // CachenSec is the number of seconds some files are cached CacheSec int }
Config contains fields which describe the server
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server runs the site
type Tokenizer ¶
type Tokenizer interface { Create(u db.User) (string, error) ReadUsername(tokenString string) (string, error) }
Tokenizer creates and reads tokens from http traffic.
type TokenizerConfig ¶
type TokenizerConfig struct { // Rand is used to generate token keys Rand *rand.Rand // TimeFunc is a function which should supply the current time since the unix epoch. // Used to set the the length of time the token is valid TimeFunc func() int64 // ValidSec is the length of time the token is valid from the issuing time, in seconds ValidSec int64 }
TokenizerConfig contains fields which describe a Tokenizer
func (TokenizerConfig) NewTokenizer ¶
func (cfg TokenizerConfig) NewTokenizer() (Tokenizer, error)
NewTokenizer creates a Tokenizer that users the random number generator to generate tokens
Click to show internal directories.
Click to hide internal directories.