Documentation ¶
Index ¶
- Constants
- func AssertContentType(t testing.TB, response *httptest.ResponseRecorder, want string)
- func AssertLeague(t testing.TB, got, want []Player)
- func AssertPlayerWin(t testing.TB, store *StubPlayerStore, winner string)
- func AssertResponseBody(t testing.TB, got, want string)
- func AssertStatus(t testing.TB, got, want int)
- func NewGetScoreRequest(name string) *http.Request
- func NewLeagueRequest() *http.Request
- func NewPostWinRequest(name string) *http.Request
- func StdOutAlerter(duration time.Duration, amount int)
- type BlindAlerter
- type BlindAlerterFunc
- type CLI
- type FileSystemPlayerStore
- type Game
- type League
- type Player
- type PlayerServer
- type PlayerStore
- type StubPlayerStore
Constants ¶
View Source
const PlayerPrompt = "Please enter the number of players: "
Variables ¶
This section is empty.
Functions ¶
func AssertContentType ¶
func AssertContentType(t testing.TB, response *httptest.ResponseRecorder, want string)
func AssertLeague ¶
func AssertPlayerWin ¶
func AssertPlayerWin(t testing.TB, store *StubPlayerStore, winner string)
func AssertResponseBody ¶
func AssertStatus ¶
func NewGetScoreRequest ¶
func NewLeagueRequest ¶
func NewPostWinRequest ¶
func StdOutAlerter ¶
Types ¶
type BlindAlerter ¶
type BlindAlerterFunc ¶
func (BlindAlerterFunc) ScheduleAlertAt ¶
func (a BlindAlerterFunc) ScheduleAlertAt(duration time.Duration, amount int)
type FileSystemPlayerStore ¶
type FileSystemPlayerStore struct {
// contains filtered or unexported fields
}
func FileSystemPlayerStoreFromFile ¶
func FileSystemPlayerStoreFromFile(path string) (*FileSystemPlayerStore, func(), error)
func NewFileSystemPlayerStore ¶
func NewFileSystemPlayerStore(file *os.File) (*FileSystemPlayerStore, error)
func (*FileSystemPlayerStore) GetLeague ¶
func (f *FileSystemPlayerStore) GetLeague() League
func (*FileSystemPlayerStore) GetPlayerScore ¶
func (f *FileSystemPlayerStore) GetPlayerScore(name string) int
func (*FileSystemPlayerStore) RecordWin ¶
func (f *FileSystemPlayerStore) RecordWin(name string)
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
func NewGame ¶
func NewGame(alerter BlindAlerter, store PlayerStore) *Game
type PlayerServer ¶
func NewPlayerServer ¶
func NewPlayerServer(store PlayerStore) *PlayerServer
type PlayerStore ¶
type StubPlayerStore ¶
type StubPlayerStore struct {
// contains filtered or unexported fields
}
func (*StubPlayerStore) GetLeague ¶
func (s *StubPlayerStore) GetLeague() League
func (*StubPlayerStore) GetPlayerScore ¶
func (s *StubPlayerStore) GetPlayerScore(name string) int
func (*StubPlayerStore) RecordWin ¶
func (s *StubPlayerStore) RecordWin(name string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.