models

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCommentParams

type AddCommentParams struct {
	Uuid        pgtype.Text
	AuthorID    int32
	EventNumber int32
	Comment     string
}

type AnnotatedGameMetadatum

type AnnotatedGameMetadatum struct {
	GameUuid         string
	CreatorUuid      string
	PrivateBroadcast bool
	Done             bool
}

type Blocking

type Blocking struct {
	UserID    pgtype.Int4
	BlockerID pgtype.Int4
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DbSession

type DbSession struct {
	Uuid      string
	ExpiresAt pgtype.Timestamptz
	Data      []byte
}

type DeleteCommentParams

type DeleteCommentParams struct {
	ID       uuid.UUID
	AuthorID int32
}

type Following

type Following struct {
	UserID     pgtype.Int4
	FollowerID pgtype.Int4
}

type Game

type Game struct {
	ID             int32
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
	DeletedAt      pgtype.Timestamptz
	Uuid           pgtype.Text
	Player0ID      pgtype.Int4
	Player1ID      pgtype.Int4
	Timers         []byte
	Started        pgtype.Bool
	GameEndReason  pgtype.Int4
	WinnerIdx      pgtype.Int4
	LoserIdx       pgtype.Int4
	Request        []byte
	History        []byte
	Stats          []byte
	Quickdata      []byte
	TournamentData []byte
	TournamentID   pgtype.Text
	ReadyFlag      pgtype.Int8
	MetaEvents     []byte
	Type           pgtype.Int4
}

type GameComment

type GameComment struct {
	ID          uuid.UUID
	GameID      int64
	AuthorID    int32
	EventNumber int32
	CreatedAt   pgtype.Timestamptz
	EditedAt    pgtype.Timestamptz
	Comment     string
}

type GameDocument

type GameDocument struct {
	GameID   string
	Document []byte
}

type GetCommentsForAllGamesParams

type GetCommentsForAllGamesParams struct {
	Limit  int32
	Offset int32
}

type GetCommentsForAllGamesRow

type GetCommentsForAllGamesRow struct {
	ID          uuid.UUID
	GameUuid    pgtype.Text
	UserUuid    pgtype.Text
	Username    pgtype.Text
	EventNumber int32
	EditedAt    pgtype.Timestamptz
	Quickdata   []byte
}

type GetCommentsForGameRow

type GetCommentsForGameRow struct {
	ID          uuid.UUID
	GameUuid    pgtype.Text
	UserUuid    pgtype.Text
	Username    pgtype.Text
	EventNumber int32
	EditedAt    pgtype.Timestamptz
	Comment     string
}

type GetPotentialPuzzleGamesAvoidBotsParams

type GetPotentialPuzzleGamesAvoidBotsParams struct {
	CreatedAt   pgtype.Timestamptz
	CreatedAt_2 pgtype.Timestamptz
	Request     []byte
	Limit       int32
	Offset      int32
}

type GetPotentialPuzzleGamesParams

type GetPotentialPuzzleGamesParams struct {
	CreatedAt   pgtype.Timestamptz
	CreatedAt_2 pgtype.Timestamptz
	Request     []byte
	Limit       int32
	Offset      int32
}

type Liststat

type Liststat struct {
	GameID    pgtype.Text
	PlayerID  pgtype.Text
	Timestamp pgtype.Int8
	StatType  pgtype.Int4
	Item      []byte
}

type Notoriousgame

type Notoriousgame struct {
	GameID    pgtype.Text
	PlayerID  pgtype.Text
	Type      pgtype.Int4
	Timestamp pgtype.Int8
}

type Profile

type Profile struct {
	ID          int32
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
	DeletedAt   pgtype.Timestamptz
	UserID      pgtype.Int4
	FirstName   pgtype.Text
	LastName    pgtype.Text
	CountryCode pgtype.Text
	Title       pgtype.Text
	About       pgtype.Text
	Ratings     []byte
	Stats       []byte
	AvatarUrl   pgtype.Text
	BirthDate   pgtype.Text
}

type Puzzle

type Puzzle struct {
	ID           int64
	Uuid         string
	GameID       int64
	TurnNumber   int32
	Answer       []byte
	AuthorID     pgtype.Int4
	Lexicon      pgtype.Text
	BeforeText   pgtype.Text
	AfterText    pgtype.Text
	Rating       []byte
	GenerationID int64
	BucketIndex  int32
	CreatedAt    pgtype.Timestamptz
	Valid        bool
}

type PuzzleAttempt

type PuzzleAttempt struct {
	PuzzleID        int64
	UserID          int64
	Correct         pgtype.Bool
	Attempts        int32
	NewUserRating   []byte
	NewPuzzleRating []byte
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
}

type PuzzleGenerationLog

type PuzzleGenerationLog struct {
	ID          int64
	Request     []byte
	Fulfilled   pgtype.Bool
	ErrorStatus pgtype.Text
	CreatedAt   pgtype.Timestamptz
	CompletedAt pgtype.Timestamptz
}

type PuzzleTag

type PuzzleTag struct {
	PuzzleID int64
	TagID    int64
}

type PuzzleTagTitle

type PuzzleTagTitle struct {
	ID       int64
	TagTitle string
}

type PuzzleVote

type PuzzleVote struct {
	PuzzleID  int64
	UserID    int64
	Vote      pgtype.Int4
	CreatedAt pgtype.Timestamptz
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddComment

func (q *Queries) AddComment(ctx context.Context, arg AddCommentParams) (uuid.UUID, error)

func (*Queries) DeleteComment

func (q *Queries) DeleteComment(ctx context.Context, arg DeleteCommentParams) error

func (*Queries) DeleteCommentNoAuthorSpecified

func (q *Queries) DeleteCommentNoAuthorSpecified(ctx context.Context, id uuid.UUID) error

func (*Queries) GetCommentsForAllGames

func (q *Queries) GetCommentsForAllGames(ctx context.Context, arg GetCommentsForAllGamesParams) ([]GetCommentsForAllGamesRow, error)

func (*Queries) GetCommentsForGame

func (q *Queries) GetCommentsForGame(ctx context.Context, argUuid pgtype.Text) ([]GetCommentsForGameRow, error)

func (*Queries) GetPotentialPuzzleGames

func (q *Queries) GetPotentialPuzzleGames(ctx context.Context, arg GetPotentialPuzzleGamesParams) ([]pgtype.Text, error)

func (*Queries) GetPotentialPuzzleGamesAvoidBots

func (q *Queries) GetPotentialPuzzleGamesAvoidBots(ctx context.Context, arg GetPotentialPuzzleGamesAvoidBotsParams) ([]pgtype.Text, error)

puzzle generation

func (*Queries) UpdateComment

func (q *Queries) UpdateComment(ctx context.Context, arg UpdateCommentParams) error

func (*Queries) WithTx

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

type Registrant

type Registrant struct {
	UserID       pgtype.Text
	TournamentID pgtype.Text
	DivisionID   pgtype.Text
}

type Soughtgame

type Soughtgame struct {
	CreatedAt           pgtype.Timestamptz
	Uuid                pgtype.Text
	Seeker              pgtype.Text
	Type                pgtype.Text
	ConnID              pgtype.Text
	Receiver            pgtype.Text
	Request             []byte
	ReceiverIsPermanent pgtype.Bool
	SeekerConnID        pgtype.Text
	ReceiverConnID      pgtype.Text
}

type Tournament

type Tournament struct {
	ID                int64
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	DeletedAt         pgtype.Timestamptz
	Uuid              pgtype.Text
	Name              pgtype.Text
	Description       pgtype.Text
	Directors         []byte
	ExecutiveDirector pgtype.Text
	IsStarted         pgtype.Bool
	Divisions         []byte
	Type              pgtype.Text
	Parent            pgtype.Text
	Slug              pgtype.Text
	DefaultSettings   []byte
	AliasOf           pgtype.Text
	IsFinished        pgtype.Bool
	ExtraMeta         []byte
}

type UpdateCommentParams

type UpdateCommentParams struct {
	Comment  string
	ID       uuid.UUID
	AuthorID int32
}

type User

type User struct {
	ID          int32
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
	DeletedAt   pgtype.Timestamptz
	Uuid        pgtype.Text
	Username    pgtype.Text
	Email       pgtype.Text
	Password    pgtype.Text
	InternalBot pgtype.Bool
	IsAdmin     pgtype.Bool
	ApiKey      pgtype.Text
	IsDirector  pgtype.Bool
	IsMod       pgtype.Bool
	Actions     []byte
	Notoriety   pgtype.Int4
}

type UserAction

type UserAction struct {
	ID          int64
	UserID      int64
	ActionType  int32
	StartTime   pgtype.Timestamptz
	EndTime     pgtype.Timestamptz
	RemovedTime pgtype.Timestamptz
	MessageID   pgtype.Text
	ApplierID   pgtype.Int8
	RemoverID   pgtype.Int8
	ChatText    pgtype.Text
	Note        pgtype.Text
	RemovalNote pgtype.Text
	EmailType   int32
}

Jump to

Keyboard shortcuts

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