Documentation ¶
Index ¶
- Constants
- type AvalonPostgresStorage
- func (s *AvalonPostgresStorage) CreatePlayer(ctx context.Context, player *avalon.PlayerImpl) error
- func (s *AvalonPostgresStorage) GetGame(ctx context.Context, id avalon.GameId) (game *avalon.GameImpl, err error)
- func (s *AvalonPostgresStorage) GetGames(ctx context.Context) (games []*avalon.GameImpl, err error)
- func (s *AvalonPostgresStorage) GetPlayer(ctx context.Context, playerId avalon.PlayerId) (player *avalon.PlayerImpl, err error)
- func (s *AvalonPostgresStorage) GetPlayersById(ctx context.Context, playerIds []avalon.PlayerId) (map[avalon.PlayerId]*avalon.PlayerImpl, error)
- func (s *AvalonPostgresStorage) RunMigrations(ctx context.Context, migrationFilesPath string) error
- func (s *AvalonPostgresStorage) SaveGame(ctx context.Context, game *avalon.GameImpl) error
- func (s *AvalonPostgresStorage) UpdatePlayers(ctx context.Context, players []*avalon.PlayerImpl) error
- func (s *AvalonPostgresStorage) WithTx(ctx context.Context, perform func(context.Context, pgx.Tx) error) (err error)
- type GameEntry
- type GameQueryOpts
- type JoinedPlayersByGame
- type PlayerEntry
- type PlayersByGameEntry
- type PlayersByGameEntryForWriting
Constants ¶
View Source
const MAX_GAMES = 100
Maximum number of games to query
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvalonPostgresStorage ¶
func NewAvalonPostgresStorage ¶
func NewAvalonPostgresStorage( ctx context.Context, connString string, ) ( store *AvalonPostgresStorage, cleanup func(), err error, )
func (*AvalonPostgresStorage) CreatePlayer ¶
func (s *AvalonPostgresStorage) CreatePlayer( ctx context.Context, player *avalon.PlayerImpl, ) error
func (*AvalonPostgresStorage) GetPlayer ¶
func (s *AvalonPostgresStorage) GetPlayer( ctx context.Context, playerId avalon.PlayerId, ) (player *avalon.PlayerImpl, err error)
func (*AvalonPostgresStorage) GetPlayersById ¶
func (s *AvalonPostgresStorage) GetPlayersById( ctx context.Context, playerIds []avalon.PlayerId, ) (map[avalon.PlayerId]*avalon.PlayerImpl, error)
func (*AvalonPostgresStorage) RunMigrations ¶
func (s *AvalonPostgresStorage) RunMigrations( ctx context.Context, migrationFilesPath string, ) error
func (*AvalonPostgresStorage) UpdatePlayers ¶
func (s *AvalonPostgresStorage) UpdatePlayers( ctx context.Context, players []*avalon.PlayerImpl, ) error
type GameQueryOpts ¶
type JoinedPlayersByGame ¶
type JoinedPlayersByGame struct { GameEntry PlayersByGameEntry }
A row from the results when joining `players_by_name` and `games` tables
type PlayerEntry ¶
Click to show internal directories.
Click to hide internal directories.