Documentation ¶
Index ¶
- Constants
- func AssertContentType(t *testing.T, response *httptest.ResponseRecorder)
- func AssertDeepEqual(t *testing.T, a interface{}, b interface{})
- func AssertEqual(t *testing.T, a interface{}, b interface{})
- func AssertEqualIntegers(t *testing.T, a int, b int)
- func AssertFileCreation(t *testing.T, err error)
- func AssertLeague(t *testing.T, response *httptest.ResponseRecorder, wantedLeague []Player)
- func AssertNoError(t *testing.T, err error)
- func AssertPlayerInStore(t *testing.T, store []string, c struct{ ... })
- func AssertPlayerWin(t *testing.T, store *StubPlayerStore, winner string)
- func AssertStatus(t *testing.T, response *httptest.ResponseRecorder, status int)
- func ErrorFileCreation(err error) error
- func ErrorFileOpening(err error, fileName string) error
- func ErrorListenAndServe(err error) error
- func ErrorParseLeague(err error) error
- func StdOutAlerter(duration time.Duration, amount int)
- type Alert
- type BlindAlerter
- type BlindAlerterFunc
- type Cli
- type FileSystemPlayerStore
- type Game
- type Holdem
- type InMemoryPlayerStore
- type League
- type Player
- type PlayerServer
- type PlayerStore
- type SpyBlindAlerter
- type SpyGame
- type StubPlayerStore
- type Tape
Constants ¶
View Source
const BadPlayerInputErrMsg = "Bad value received for number of players, please try again with a number"
View Source
const BadWinnerErrMsg = "Bad value received for winner, please enter in the specified format"
View Source
const PlayerPrompt = "Please enter the number of players: "
Variables ¶
This section is empty.
Functions ¶
func AssertContentType ¶
func AssertContentType(t *testing.T, response *httptest.ResponseRecorder)
func AssertDeepEqual ¶
func AssertEqual ¶
func AssertFileCreation ¶
func AssertLeague ¶
func AssertLeague(t *testing.T, response *httptest.ResponseRecorder, wantedLeague []Player)
func AssertNoError ¶
func AssertPlayerInStore ¶
func AssertPlayerWin ¶
func AssertPlayerWin(t *testing.T, store *StubPlayerStore, winner string)
func AssertStatus ¶
func AssertStatus(t *testing.T, response *httptest.ResponseRecorder, status int)
func ErrorFileCreation ¶
func ErrorFileOpening ¶
func ErrorListenAndServe ¶
func ErrorParseLeague ¶
func StdOutAlerter ¶
Types ¶
type BlindAlerter ¶
type BlindAlerterFunc ¶
func (BlindAlerterFunc) ScheduleAlertAt ¶
func (b BlindAlerterFunc) ScheduleAlertAt(duration time.Duration, amount int)
type FileSystemPlayerStore ¶
type FileSystemPlayerStore struct {
// contains filtered or unexported fields
}
func FileSystemPlayerStoreFromFile ¶
func FileSystemPlayerStoreFromFile(dbFileName string) (*FileSystemPlayerStore, func(), error)
func NewFileSystemPlayerStore ¶
func NewFileSystemPlayerStore(file *os.File) (*FileSystemPlayerStore, error)
func (*FileSystemPlayerStore) GetLeague ¶
func (i *FileSystemPlayerStore) GetLeague() League
func (*FileSystemPlayerStore) RecordWin ¶
func (i *FileSystemPlayerStore) RecordWin(player string)
type Holdem ¶
type Holdem struct {
// contains filtered or unexported fields
}
func NewHoldem ¶
func NewHoldem(store PlayerStore, alerter BlindAlerter) *Holdem
type InMemoryPlayerStore ¶
type InMemoryPlayerStore struct {
// contains filtered or unexported fields
}
func NewInMemoryPlayerStore ¶
func NewInMemoryPlayerStore() *InMemoryPlayerStore
func (*InMemoryPlayerStore) GetLeague ¶
func (i *InMemoryPlayerStore) GetLeague() League
func (*InMemoryPlayerStore) RecordWin ¶
func (i *InMemoryPlayerStore) RecordWin(player string)
type PlayerServer ¶
func NewPlayerServer ¶
func NewPlayerServer(store PlayerStore) (*PlayerServer, error)
type PlayerStore ¶
type SpyBlindAlerter ¶
type SpyBlindAlerter struct {
// contains filtered or unexported fields
}
func (*SpyBlindAlerter) Alerts ¶
func (s *SpyBlindAlerter) Alerts() []Alert
func (*SpyBlindAlerter) ScheduleAlertAt ¶
func (s *SpyBlindAlerter) ScheduleAlertAt(duration time.Duration, amount int)
type StubPlayerStore ¶
type StubPlayerStore struct {
// contains filtered or unexported fields
}
func (*StubPlayerStore) GetLeague ¶
func (s *StubPlayerStore) GetLeague() League
func (*StubPlayerStore) RecordWin ¶
func (s *StubPlayerStore) RecordWin(player string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.