db

package
v0.0.0-...-c8194c3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrItemNotFound      = errors.New("item not found")
	ErrItemAlreadyExists = errors.New("item already exists")
)

Functions

This section is empty.

Types

type DB

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

func NewDB

func NewDB(tableName string, dynamoClient DynamoDBClient) *DB

func (*DB) AddPlayer

func (db *DB) AddPlayer(ctx context.Context, newPlayer model.Player) (*model.Player, error)

func (*DB) AddSeason

func (db *DB) AddSeason(ctx context.Context, season model.Season) (*model.Season, error)

func (*DB) AddTeam

func (db *DB) AddTeam(ctx context.Context, newTeam model.Team) (*model.Team, error)

func (*DB) GetAllPlayers

func (db *DB) GetAllPlayers(ctx context.Context) ([]model.Player, error)

func (*DB) GetAllSeasons

func (db *DB) GetAllSeasons(ctx context.Context) ([]model.Season, error)

func (*DB) GetAllTeams

func (db *DB) GetAllTeams(ctx context.Context) ([]model.Team, error)

func (*DB) GetPlayer

func (db *DB) GetPlayer(ctx context.Context, id uuid.UUID) (*model.Player, error)

func (*DB) GetSeason

func (db *DB) GetSeason(ctx context.Context, id uuid.UUID) (*model.Season, error)

func (*DB) GetTeam

func (db *DB) GetTeam(ctx context.Context, id uuid.UUID) (*model.Team, error)

func (*DB) UpdatePlayer

func (db *DB) UpdatePlayer(ctx context.Context, id uuid.UUID, updates UpdatePlayerInput) (*model.Player, error)

func (*DB) UpdateSeason

func (db *DB) UpdateSeason(ctx context.Context, id uuid.UUID, updates UpdateSeasonInput) (*model.Season, error)

func (*DB) UpdateTeam

func (db *DB) UpdateTeam(ctx context.Context, id uuid.UUID, updates UpdateTeamInput) (*model.Team, error)

type UpdatePlayerInput

type UpdatePlayerInput struct {
	FirstName *string
	LastName  *string
}

type UpdateSeasonInput

type UpdateSeasonInput struct {
	Name      *string
	StartDate *time.Time
	EndDate   *time.Time
	ByeWeeks  *[]time.Time
}

type UpdateTeamInput

type UpdateTeamInput struct {
	Name       *string
	TeamColors *[]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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