Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystemPlayerStore ¶
type FileSystemPlayerStore struct {
// contains filtered or unexported fields
}
FileSystemPlayerStore stores players in the filesystem.
func NewFileSystemPlayerStore ¶
func NewFileSystemPlayerStore(file *os.File) (*FileSystemPlayerStore, error)
NewFileSystemPlayerStore creates a FileSystemPlayerStore initialising the store if needed.
func (*FileSystemPlayerStore) GetLeague ¶
func (f *FileSystemPlayerStore) GetLeague() League
GetLeague returns the scores of all the players.
func (*FileSystemPlayerStore) GetPlayerScore ¶
func (f *FileSystemPlayerStore) GetPlayerScore(name string) int
GetPlayerScore retrieves a player's score.
func (*FileSystemPlayerStore) RecordWin ¶
func (f *FileSystemPlayerStore) RecordWin(name string)
RecordWin will store a win for a player, incrementing wins if already known.
type League ¶
type League []Player
League stores a collection of players.
type PlayerServer ¶
PlayerServer is a HTTP interface for player information.
func NewPlayerServer ¶
func NewPlayerServer(store PlayerStore) *PlayerServer
NewPlayerServer creates a PlayerServer with routing configured.