matches_gen

package
v0.0.0-...-7c98acb Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddMatchParams

type AddMatchParams struct {
	ID        string
	UserID    string
	ServerID  string
	Team1ID   string
	Team2ID   string
	StartTime sql.NullTime
	EndTime   sql.NullTime
	MaxMaps   int32
	Title     string
	SkipVeto  bool
	ApiKey    string
	Status    int32
}

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 GetMatchesByTeamParams

type GetMatchesByTeamParams struct {
	Team1ID string
	Team2ID string
}

type Match

type Match struct {
	ID         string
	UserID     string
	ServerID   string
	Team1ID    string
	Team2ID    string
	Winner     sql.NullString
	Cancelled  bool
	StartTime  sql.NullTime
	EndTime    sql.NullTime
	MaxMaps    int32
	Title      string
	SkipVeto   bool
	ApiKey     string
	Team1Score uint32
	Team2Score uint32
	Forfeit    sql.NullBool
	Status     int32
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddMatch

func (q *Queries) AddMatch(ctx context.Context, arg AddMatchParams) (sql.Result, error)

func (*Queries) CancelMatch

func (q *Queries) CancelMatch(ctx context.Context, id string) (sql.Result, error)

func (*Queries) GetMatch

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

func (*Queries) GetMatchesByTeam

func (q *Queries) GetMatchesByTeam(ctx context.Context, arg GetMatchesByTeamParams) ([]Match, error)

func (*Queries) GetMatchesByUser

func (q *Queries) GetMatchesByUser(ctx context.Context, userID string) ([]Match, error)

func (*Queries) GetMatchesByUsers

func (q *Queries) GetMatchesByUsers(ctx context.Context, userIds []string) ([]Match, error)

func (*Queries) GetMatchesByWinner

func (q *Queries) GetMatchesByWinner(ctx context.Context, winner sql.NullString) ([]Match, error)

func (*Queries) StartMatch

func (q *Queries) StartMatch(ctx context.Context, arg StartMatchParams) (sql.Result, error)

func (*Queries) UpdateMatchWinner

func (q *Queries) UpdateMatchWinner(ctx context.Context, arg UpdateMatchWinnerParams) (sql.Result, error)

func (*Queries) UpdateTeam1Score

func (q *Queries) UpdateTeam1Score(ctx context.Context, arg UpdateTeam1ScoreParams) (sql.Result, error)

func (*Queries) UpdateTeam2Score

func (q *Queries) UpdateTeam2Score(ctx context.Context, arg UpdateTeam2ScoreParams) (sql.Result, error)

func (*Queries) WithTx

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

type StartMatchParams

type StartMatchParams struct {
	StartTime sql.NullTime
	ID        string
}

type UpdateMatchWinnerParams

type UpdateMatchWinnerParams struct {
	Winner     sql.NullString
	EndTime    sql.NullTime
	Forfeit    sql.NullBool
	Team1Score uint32
	Team2Score uint32
	ID         string
}

type UpdateTeam1ScoreParams

type UpdateTeam1ScoreParams struct {
	Team1Score uint32
	ID         string
}

type UpdateTeam2ScoreParams

type UpdateTeam2ScoreParams struct {
	Team2Score uint32
	ID         string
}

Jump to

Keyboard shortcuts

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