db

package
v0.0.0-...-ac404fd Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	ID       string  `json:"id"`
	MatchID  string  `json:"match_id"`
	TeamID   string  `json:"team_id"`
	PlayerID string  `json:"player_id"`
	Action   string  `json:"action"`
	Minute   int32   `json:"minute"`
	Score    float64 `json:"score"`
}

type AddPlayerToMyTeamParams

type AddPlayerToMyTeamParams struct {
	MyTeamID string `json:"my_team_id"`
	PlayerID string `json:"player_id"`
}

type AddScoreToTeamParams

type AddScoreToTeamParams struct {
	Score float64 `json:"score"`
	ID    string  `json:"id"`
}

type CreateActionParams

type CreateActionParams struct {
	ID       string  `json:"id"`
	MatchID  string  `json:"match_id"`
	TeamID   string  `json:"team_id"`
	PlayerID string  `json:"player_id"`
	Action   string  `json:"action"`
	Score    float64 `json:"score"`
	Minute   int32   `json:"minute"`
}

type CreateMatchParams

type CreateMatchParams struct {
	ID        string         `json:"id"`
	MatchDate sql.NullTime   `json:"match_date"`
	TeamAID   sql.NullString `json:"team_a_id"`
	TeamAName sql.NullString `json:"team_a_name"`
	TeamBID   sql.NullString `json:"team_b_id"`
	TeamBName sql.NullString `json:"team_b_name"`
	Result    sql.NullString `json:"result"`
}

type CreateMyTeamParams

type CreateMyTeamParams struct {
	ID    string  `json:"id"`
	Name  string  `json:"name"`
	Score float64 `json:"score"`
}

type CreatePlayerParams

type CreatePlayerParams struct {
	ID    string  `json:"id"`
	Name  string  `json:"name"`
	Price float64 `json:"price"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type Match

type Match struct {
	ID        string         `json:"id"`
	MatchDate sql.NullTime   `json:"match_date"`
	TeamAID   sql.NullString `json:"team_a_id"`
	TeamAName sql.NullString `json:"team_a_name"`
	TeamBID   sql.NullString `json:"team_b_id"`
	TeamBName sql.NullString `json:"team_b_name"`
	Result    sql.NullString `json:"result"`
}

type MyTeam

type MyTeam struct {
	ID    string  `json:"id"`
	Name  string  `json:"name"`
	Score float64 `json:"score"`
}

type MyTeamPlayer

type MyTeamPlayer struct {
	MyTeamID string `json:"my_team_id"`
	PlayerID string `json:"player_id"`
}

type Player

type Player struct {
	ID    string  `json:"id"`
	Name  string  `json:"name"`
	Price float64 `json:"price"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddPlayerToMyTeam

func (q *Queries) AddPlayerToMyTeam(ctx context.Context, arg AddPlayerToMyTeamParams) error

func (*Queries) AddScoreToTeam

func (q *Queries) AddScoreToTeam(ctx context.Context, arg AddScoreToTeamParams) error

func (*Queries) CreateAction

func (q *Queries) CreateAction(ctx context.Context, arg CreateActionParams) error

func (*Queries) CreateMatch

func (q *Queries) CreateMatch(ctx context.Context, arg CreateMatchParams) error

func (*Queries) CreateMyTeam

func (q *Queries) CreateMyTeam(ctx context.Context, arg CreateMyTeamParams) error

func (*Queries) CreatePlayer

func (q *Queries) CreatePlayer(ctx context.Context, arg CreatePlayerParams) error

func (*Queries) DeleteAllPlayersFromMyTeam

func (q *Queries) DeleteAllPlayersFromMyTeam(ctx context.Context, myTeamID string) error

func (*Queries) FindAllMatches

func (q *Queries) FindAllMatches(ctx context.Context) ([]Match, error)

func (*Queries) FindAllPlayers

func (q *Queries) FindAllPlayers(ctx context.Context) ([]Player, error)

func (*Queries) FindAllPlayersByIDs

func (q *Queries) FindAllPlayersByIDs(ctx context.Context, id string) ([]Player, error)

func (*Queries) FindMatchById

func (q *Queries) FindMatchById(ctx context.Context, id string) (Match, error)

func (*Queries) FindMyTeamById

func (q *Queries) FindMyTeamById(ctx context.Context, id string) (MyTeam, error)

func (*Queries) FindMyTeamByIdForUpdate

func (q *Queries) FindMyTeamByIdForUpdate(ctx context.Context, id string) (MyTeam, error)

func (*Queries) FindPlayerById

func (q *Queries) FindPlayerById(ctx context.Context, id string) (Player, error)

func (*Queries) FindPlayerByIdForUpdate

func (q *Queries) FindPlayerByIdForUpdate(ctx context.Context, id string) (Player, error)

func (*Queries) FindTeamById

func (q *Queries) FindTeamById(ctx context.Context, id string) (Team, error)

func (*Queries) GetMatchActions

func (q *Queries) GetMatchActions(ctx context.Context, matchID string) ([]Action, error)

func (*Queries) GetMatchActionsForUpdate

func (q *Queries) GetMatchActionsForUpdate(ctx context.Context, matchID string) ([]Action, error)

func (*Queries) GetMyTeamBalance

func (q *Queries) GetMyTeamBalance(ctx context.Context, id string) (float64, error)

func (*Queries) GetPlayersByMyTeamID

func (q *Queries) GetPlayersByMyTeamID(ctx context.Context, myTeamID string) ([]Player, error)

func (*Queries) RemoveActionFromMatch

func (q *Queries) RemoveActionFromMatch(ctx context.Context, matchID string) error

func (*Queries) UpdateMatch

func (q *Queries) UpdateMatch(ctx context.Context, arg UpdateMatchParams) error

func (*Queries) UpdateMyTeamScore

func (q *Queries) UpdateMyTeamScore(ctx context.Context, arg UpdateMyTeamScoreParams) error

func (*Queries) UpdateMyTeamsScore

func (q *Queries) UpdateMyTeamsScore(ctx context.Context, arg UpdateMyTeamsScoreParams) error

func (*Queries) UpdatePlayer

func (q *Queries) UpdatePlayer(ctx context.Context, arg UpdatePlayerParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Team

type Team struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type TeamPlayer

type TeamPlayer struct {
	TeamID   string `json:"team_id"`
	PlayerID string `json:"player_id"`
}

type UpdateMatchParams

type UpdateMatchParams struct {
	MatchDate sql.NullTime   `json:"match_date"`
	TeamAID   sql.NullString `json:"team_a_id"`
	TeamAName sql.NullString `json:"team_a_name"`
	TeamBID   sql.NullString `json:"team_b_id"`
	TeamBName sql.NullString `json:"team_b_name"`
	Result    sql.NullString `json:"result"`
	ID        string         `json:"id"`
}

type UpdateMyTeamScoreParams

type UpdateMyTeamScoreParams struct {
	Score float64 `json:"score"`
	ID    string  `json:"id"`
}

type UpdateMyTeamsScoreParams

type UpdateMyTeamsScoreParams struct {
	Score float64 `json:"score"`
	ID    string  `json:"id"`
}

type UpdatePlayerParams

type UpdatePlayerParams struct {
	Name  string  `json:"name"`
	Price float64 `json:"price"`
	ID    string  `json:"id"`
}

Jump to

Keyboard shortcuts

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