Documentation ¶
Index ¶
- func AddMoveToMemory(move Move, pool *pgxpool.Pool) error
- func AddNewUser(username, passwordHash string, pool *pgxpool.Pool) (uuid.UUID, error)
- func DeleteGameMemory(ctx context.Context, gameID string, writePool *pgxpool.Pool) error
- func InitiateNewGame(playerA, playerB uuid.UUID, writePool *pgxpool.Pool) (uuid.UUID, error)
- func PingPooledConnections(ctx context.Context, p *pooledConnections) error
- func UpdateGameOutcome(gameID uuid.UUID, outcome string, pool *pgxpool.Pool) error
- type Game
- type Move
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMoveToMemory ¶
AddMoveToMemory() adds a move to the moves table
func AddNewUser ¶
func DeleteGameMemory ¶
uses a transaction to delete from both tables all at once or not at all/
func InitiateNewGame ¶
func PingPooledConnections ¶
check that the pools are working one at a time
Types ¶
type Game ¶
type Move ¶
type Move struct { MoveID int `db:"move_id"` GameID uuid.UUID `db:"game_id"` PlayerID uuid.UUID `db:"player_id"` PlayerCode string `db:"player_code"` PlayerGameCode string `db:"player_game_code"` MoveDescription string `db:"move_description"` MoveTime time.Time `db:"move_time"` // Assuming from the latest three moves function MoveCounter int `db:"move_counter"` }
func FetchAllMovesForGameID ¶
Click to show internal directories.
Click to hide internal directories.