Documentation ¶
Index ¶
- Variables
- type DB
- func (db *DB) AddPlayer(ctx context.Context, newPlayer model.Player) (*model.Player, error)
- func (db *DB) AddSeason(ctx context.Context, season model.Season) (*model.Season, error)
- func (db *DB) AddTeam(ctx context.Context, newTeam model.Team) (*model.Team, error)
- func (db *DB) GetAllPlayers(ctx context.Context) ([]model.Player, error)
- func (db *DB) GetAllSeasons(ctx context.Context) ([]model.Season, error)
- func (db *DB) GetAllTeams(ctx context.Context) ([]model.Team, error)
- func (db *DB) GetPlayer(ctx context.Context, id uuid.UUID) (*model.Player, error)
- func (db *DB) GetSeason(ctx context.Context, id uuid.UUID) (*model.Season, error)
- func (db *DB) GetTeam(ctx context.Context, id uuid.UUID) (*model.Team, error)
- func (db *DB) UpdatePlayer(ctx context.Context, id uuid.UUID, updates UpdatePlayerInput) (*model.Player, error)
- func (db *DB) UpdateSeason(ctx context.Context, id uuid.UUID, updates UpdateSeasonInput) (*model.Season, error)
- func (db *DB) UpdateTeam(ctx context.Context, id uuid.UUID, updates UpdateTeamInput) (*model.Team, error)
- type DynamoDBClient
- type UpdatePlayerInput
- type UpdateSeasonInput
- type UpdateTeamInput
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) UpdatePlayer ¶
func (*DB) UpdateSeason ¶
type DynamoDBClient ¶
type DynamoDBClient interface { GetItem(context.Context, *dynamodb.GetItemInput, ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error) PutItem(context.Context, *dynamodb.PutItemInput, ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error) Query(context.Context, *dynamodb.QueryInput, ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error) UpdateItem(context.Context, *dynamodb.UpdateItemInput, ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error) TransactWriteItems(ctx context.Context, params *dynamodb.TransactWriteItemsInput, optFns ...func(*dynamodb.Options)) (*dynamodb.TransactWriteItemsOutput, error) }
type UpdatePlayerInput ¶
type UpdateSeasonInput ¶
type UpdateTeamInput ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.