Documentation ¶
Index ¶
- Constants
- func Alerter(duration time.Duration, amount int, to io.Writer)
- func AssertLeague(t *testing.T, server *PlayerServer, want Players)
- func AssertResponseBody(t *testing.T, response *httptest.ResponseRecorder, want string)
- func AssertStatus(t *testing.T, response *httptest.ResponseRecorder, want int)
- func CreateTempFile(t *testing.T, initialData string) (*os.File, func())
- func FetchGameRequest() *http.Request
- func FetchIndexScoreRequest() *http.Request
- func FetchShowScoreRequest(name string) *http.Request
- func FetchUpdateScoreRequest(name string) *http.Request
- func NewTape(file *os.File) *tape
- func RelativePath(elem ...string) string
- type BlindAlerter
- type BlindAlerterFunc
- type ByWins
- type CLI
- type DatabasePlayerStore
- type FileSystemPlayerStore
- type Game
- type InMemoryPlayerStore
- type Player
- type PlayerServer
- type PlayerStore
- type Players
- type SpyGame
- type StubPlayerStore
- type TexasHoldemGame
Constants ¶
View Source
const PlayerPrompt = "Please enter number of players: "
Variables ¶
This section is empty.
Functions ¶
func AssertLeague ¶
func AssertLeague(t *testing.T, server *PlayerServer, want Players)
func AssertResponseBody ¶
func AssertResponseBody(t *testing.T, response *httptest.ResponseRecorder, want string)
func AssertStatus ¶
func AssertStatus(t *testing.T, response *httptest.ResponseRecorder, want int)
func FetchGameRequest ¶
func FetchIndexScoreRequest ¶
func FetchShowScoreRequest ¶
func FetchUpdateScoreRequest ¶
func RelativePath ¶
Types ¶
type BlindAlerter ¶
type BlindAlerterFunc ¶
func (BlindAlerterFunc) ScheduleAlertAt ¶
type DatabasePlayerStore ¶
type DatabasePlayerStore struct {
// contains filtered or unexported fields
}
func NewDatabasePlayerStore ¶
func NewDatabasePlayerStore(debugSync, debug bool) *DatabasePlayerStore
func (*DatabasePlayerStore) GetLeague ¶
func (store *DatabasePlayerStore) GetLeague() (players Players)
func (*DatabasePlayerStore) GetPlayerScore ¶
func (store *DatabasePlayerStore) GetPlayerScore(name string) int
func (*DatabasePlayerStore) RecordWin ¶
func (store *DatabasePlayerStore) RecordWin(name string)
type FileSystemPlayerStore ¶
type FileSystemPlayerStore struct {
// contains filtered or unexported fields
}
func NewFileSystemPlayerStore ¶
func NewFileSystemPlayerStore(file *os.File) *FileSystemPlayerStore
func NewFileSystemPlayerStoreFromFileName ¶
func NewFileSystemPlayerStoreFromFileName(fileName string) (*FileSystemPlayerStore, func(), error)
func (*FileSystemPlayerStore) GetLeague ¶
func (store *FileSystemPlayerStore) GetLeague() Players
func (*FileSystemPlayerStore) GetPlayerScore ¶
func (store *FileSystemPlayerStore) GetPlayerScore(name string) int
func (*FileSystemPlayerStore) RecordWin ¶
func (store *FileSystemPlayerStore) RecordWin(name string)
type InMemoryPlayerStore ¶
type InMemoryPlayerStore struct {
// contains filtered or unexported fields
}
func NewInMemoryPlayerStore ¶
func NewInMemoryPlayerStore() *InMemoryPlayerStore
func (*InMemoryPlayerStore) GetLeague ¶
func (store *InMemoryPlayerStore) GetLeague() (players Players)
func (*InMemoryPlayerStore) GetPlayerScore ¶
func (store *InMemoryPlayerStore) GetPlayerScore(name string) int
func (*InMemoryPlayerStore) RecordWin ¶
func (store *InMemoryPlayerStore) RecordWin(name string)
type Player ¶
func (*Player) TableIndex ¶
type PlayerServer ¶
func EnsurePlayerServer ¶
func EnsurePlayerServer(t *testing.T, store PlayerStore, game Game) *PlayerServer
func NewPlayerServer ¶
func NewPlayerServer(store PlayerStore, game Game) (*PlayerServer, error)
type PlayerStore ¶
type SpyGame ¶
type StubPlayerStore ¶
func (*StubPlayerStore) GetLeague ¶
func (store *StubPlayerStore) GetLeague() Players
func (*StubPlayerStore) GetPlayerScore ¶
func (store *StubPlayerStore) GetPlayerScore(name string) int
func (*StubPlayerStore) RecordWin ¶
func (store *StubPlayerStore) RecordWin(name string)
type TexasHoldemGame ¶
type TexasHoldemGame struct {
// contains filtered or unexported fields
}
func NewTexasHoldem ¶
func NewTexasHoldem(alerter BlindAlerter, store PlayerStore) *TexasHoldemGame
func (TexasHoldemGame) Finish ¶
func (game TexasHoldemGame) Finish(winner string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.