gamedb

package
v0.0.0-...-53b8cb7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package gamedb contains game related CRUD functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store manages the set of APIs for user database access.

func NewStore

func NewStore(log *logger.Logger, db *sqlx.DB) *Store

NewStore constructs the api for data access.

func (*Store) Create

func (s *Store) Create(ctx context.Context, g *game.Game) error

Create adds a game to the db.

func (*Store) InsertRound

func (s *Store) InsertRound(ctx context.Context, state game.State) error

InsertRound adds a new set of state records for a given round to the db.

func (*Store) QueryStateByID

func (s *Store) QueryStateByID(ctx context.Context, gameID uuid.UUID, round int) (game.State, error)

QueryStateByID gets the specified game state from the database.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL