db

package
v0.0.0-...-2c8bb3a Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 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, entityTypeIndexName string, dynamoClient DynamoDBClient) *DB

func (*DB) AddSeason

func (db *DB) AddSeason(ctx context.Context, newSeason SeasonInput) (*Season, error)

func (*DB) GetAllSeasons

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

func (*DB) GetSeason

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

func (*DB) GetSeasonByName

func (db *DB) GetSeasonByName(ctx context.Context, name string) (*Season, error)

func (*DB) UpdateSeason

func (db *DB) UpdateSeason(ctx context.Context, id uuid.UUID, season SeasonInput) (*Season, error)

type Game

type Game struct {
	ID            uuid.UUID
	DateTime      time.Time
	SeasonID      uuid.UUID
	HomeTeamID    uuid.UUID
	AwayTeamID    uuid.UUID
	HomeTeamScore int
	AwayTeamScore int
	YoutubeURL    string
}

type Season

type Season struct {
	UUID      uuid.UUID
	Name      string
	StartDate time.Time
	EndDate   time.Time
	ByeWeeks  []time.Time
}

type SeasonInput

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

type Team

type Team struct {
	ID         uuid.UUID
	SeasonID   uuid.UUID
	Name       string
	TeamColors []string
	Captain    string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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