db

package
v0.0.0-...-51943a4 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type CheckPuzzleIsCreatedParams

type CheckPuzzleIsCreatedParams struct {
	Name      string `json:"name"`
	PuzzleURL string `json:"puzzle_url"`
}

type CheckPuzzleIsDiscoveredParams

type CheckPuzzleIsDiscoveredParams struct {
	Name      string `json:"name"`
	PuzzleURL string `json:"puzzle_url"`
}

type CompleteDiscoveredRoundParams

type CompleteDiscoveredRoundParams struct {
	ID        int64 `json:"id"`
	CreatedAs int64 `json:"created_as"`
}

type CreateDiscoveredPuzzleParams

type CreateDiscoveredPuzzleParams struct {
	PuzzleURL       string        `json:"puzzle_url"`
	Name            string        `json:"name"`
	DiscoveredRound sql.NullInt64 `json:"discovered_round"`
}

type CreateDiscoveredRoundParams

type CreateDiscoveredRoundParams struct {
	Name       string    `json:"name"`
	MessageID  string    `json:"message_id"`
	NotifiedAt time.Time `json:"notified_at"`
	CreatedAs  int64     `json:"created_as"`
}

type CreatePuzzleParams

type CreatePuzzleParams struct {
	Name           string        `json:"name"`
	Answer         string        `json:"answer"`
	Round          int64         `json:"round"`
	Status         status.Status `json:"status"`
	Note           string        `json:"note"`
	Location       string        `json:"location"`
	PuzzleURL      string        `json:"puzzle_url"`
	SpreadsheetID  string        `json:"spreadsheet_id"`
	DiscordChannel string        `json:"discord_channel"`
	Meta           bool          `json:"meta"`
	VoiceRoom      string        `json:"voice_room"`
	Reminder       time.Time     `json:"reminder"`
}

type CreateRoundParams

type CreateRoundParams struct {
	Name            string `json:"name"`
	Emoji           string `json:"emoji"`
	Hue             int64  `json:"hue"`
	Sort            int64  `json:"sort"`
	Special         bool   `json:"special"`
	DriveFolder     string `json:"drive_folder"`
	DiscordCategory string `json:"discord_category"`
}

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 DiscoveredPuzzle

type DiscoveredPuzzle struct {
	ID              int64         `json:"id"`
	PuzzleURL       string        `json:"puzzle_url"`
	Name            string        `json:"name"`
	DiscoveredRound sql.NullInt64 `json:"discovered_round"`
}

type DiscoveredRound

type DiscoveredRound struct {
	ID         int64     `json:"id"`
	Name       string    `json:"name"`
	MessageID  string    `json:"message_id"`
	NotifiedAt time.Time `json:"notified_at"`
	CreatedAs  int64     `json:"created_as"`
}

type GetPuzzleByChannelRow

type GetPuzzleByChannelRow struct {
	ID             int64         `json:"id"`
	Name           string        `json:"name"`
	Answer         string        `json:"answer"`
	Round          Round         `json:"round"`
	Status         status.Status `json:"status"`
	Note           string        `json:"note"`
	Location       string        `json:"location"`
	PuzzleURL      string        `json:"puzzle_url"`
	SpreadsheetID  string        `json:"spreadsheet_id"`
	DiscordChannel string        `json:"discord_channel"`
	Meta           bool          `json:"meta"`
	VoiceRoom      string        `json:"voice_room"`
	Reminder       time.Time     `json:"reminder"`
}

type GetPuzzleRow

type GetPuzzleRow struct {
	ID             int64         `json:"id"`
	Name           string        `json:"name"`
	Answer         string        `json:"answer"`
	Round          Round         `json:"round"`
	Status         status.Status `json:"status"`
	Note           string        `json:"note"`
	Location       string        `json:"location"`
	PuzzleURL      string        `json:"puzzle_url"`
	SpreadsheetID  string        `json:"spreadsheet_id"`
	DiscordChannel string        `json:"discord_channel"`
	Meta           bool          `json:"meta"`
	VoiceRoom      string        `json:"voice_room"`
	Reminder       time.Time     `json:"reminder"`
}

type GetPuzzlesByVoiceRoomRow

type GetPuzzlesByVoiceRoomRow struct {
	ID             int64         `json:"id"`
	Name           string        `json:"name"`
	Answer         string        `json:"answer"`
	Round          Round         `json:"round"`
	Status         status.Status `json:"status"`
	Note           string        `json:"note"`
	Location       string        `json:"location"`
	PuzzleURL      string        `json:"puzzle_url"`
	SpreadsheetID  string        `json:"spreadsheet_id"`
	DiscordChannel string        `json:"discord_channel"`
	Meta           bool          `json:"meta"`
	VoiceRoom      string        `json:"voice_room"`
	Reminder       time.Time     `json:"reminder"`
}

type ListCreatablePuzzlesRow

type ListCreatablePuzzlesRow struct {
	ID              int64         `json:"id"`
	PuzzleURL       string        `json:"puzzle_url"`
	Name            string        `json:"name"`
	DiscoveredRound sql.NullInt64 `json:"discovered_round"`
	ID_2            int64         `json:"id_2"`
	Name_2          string        `json:"name_2"`
	MessageID       string        `json:"message_id"`
	NotifiedAt      time.Time     `json:"notified_at"`
	CreatedAs       int64         `json:"created_as"`
}

type ListPuzzlesByRoundRow

type ListPuzzlesByRoundRow struct {
	ID             int64         `json:"id"`
	Name           string        `json:"name"`
	Answer         string        `json:"answer"`
	Round          Round         `json:"round"`
	Status         status.Status `json:"status"`
	Note           string        `json:"note"`
	Location       string        `json:"location"`
	PuzzleURL      string        `json:"puzzle_url"`
	SpreadsheetID  string        `json:"spreadsheet_id"`
	DiscordChannel string        `json:"discord_channel"`
	Meta           bool          `json:"meta"`
	VoiceRoom      string        `json:"voice_room"`
	Reminder       time.Time     `json:"reminder"`
}

type ListPuzzlesByVoiceRoomRow

type ListPuzzlesByVoiceRoomRow struct {
	ID        int64  `json:"id"`
	Name      string `json:"name"`
	VoiceRoom string `json:"voice_room"`
}

type ListPuzzlesRow

type ListPuzzlesRow struct {
	ID             int64         `json:"id"`
	Name           string        `json:"name"`
	Answer         string        `json:"answer"`
	Round          Round         `json:"round"`
	Status         status.Status `json:"status"`
	Note           string        `json:"note"`
	Location       string        `json:"location"`
	PuzzleURL      string        `json:"puzzle_url"`
	SpreadsheetID  string        `json:"spreadsheet_id"`
	DiscordChannel string        `json:"discord_channel"`
	Meta           bool          `json:"meta"`
	VoiceRoom      string        `json:"voice_room"`
	Reminder       time.Time     `json:"reminder"`
}

type Puzzle

type Puzzle struct {
	ID             int64         `json:"id"`
	Name           string        `json:"name"`
	Answer         string        `json:"answer"`
	Round          int64         `json:"round"`
	Status         status.Status `json:"status"`
	Note           string        `json:"note"`
	Location       string        `json:"location"`
	PuzzleURL      string        `json:"puzzle_url"`
	SpreadsheetID  string        `json:"spreadsheet_id"`
	DiscordChannel string        `json:"discord_channel"`
	Meta           bool          `json:"meta"`
	VoiceRoom      string        `json:"voice_room"`
	Reminder       time.Time     `json:"reminder"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CheckPuzzleIsCreated

func (q *Queries) CheckPuzzleIsCreated(ctx context.Context, arg CheckPuzzleIsCreatedParams) (int64, error)

func (*Queries) CheckPuzzleIsDiscovered

func (q *Queries) CheckPuzzleIsDiscovered(ctx context.Context, arg CheckPuzzleIsDiscoveredParams) (int64, error)

func (*Queries) ClearPuzzleVoiceRoom

func (q *Queries) ClearPuzzleVoiceRoom(ctx context.Context, voiceRoom string) error

func (*Queries) CompleteDiscoveredPuzzle

func (q *Queries) CompleteDiscoveredPuzzle(ctx context.Context, id int64) error

func (*Queries) CompleteDiscoveredRound

func (q *Queries) CompleteDiscoveredRound(ctx context.Context, arg CompleteDiscoveredRoundParams) error

func (*Queries) CreateDiscoveredPuzzle

func (q *Queries) CreateDiscoveredPuzzle(ctx context.Context, arg CreateDiscoveredPuzzleParams) error

func (*Queries) CreateDiscoveredRound

func (q *Queries) CreateDiscoveredRound(ctx context.Context, arg CreateDiscoveredRoundParams) (int64, error)

func (*Queries) CreatePuzzle

func (q *Queries) CreatePuzzle(ctx context.Context, arg CreatePuzzleParams) (int64, error)

func (*Queries) CreateRound

func (q *Queries) CreateRound(ctx context.Context, arg CreateRoundParams) (Round, error)

func (*Queries) DeletePuzzle

func (q *Queries) DeletePuzzle(ctx context.Context, id int64) error

func (*Queries) DeleteRound

func (q *Queries) DeleteRound(ctx context.Context, id int64) error

func (*Queries) GetCreatedRound

func (q *Queries) GetCreatedRound(ctx context.Context, name string) (Round, error)

func (*Queries) GetDiscoveredRound

func (q *Queries) GetDiscoveredRound(ctx context.Context, name string) (DiscoveredRound, error)

func (*Queries) GetPuzzle

func (q *Queries) GetPuzzle(ctx context.Context, id int64) (GetPuzzleRow, error)

func (*Queries) GetPuzzleByChannel

func (q *Queries) GetPuzzleByChannel(ctx context.Context, discordChannel string) (GetPuzzleByChannelRow, error)

func (*Queries) GetPuzzlesByVoiceRoom

func (q *Queries) GetPuzzlesByVoiceRoom(ctx context.Context, voiceRoom string) ([]GetPuzzlesByVoiceRoomRow, error)

func (*Queries) GetRound

func (q *Queries) GetRound(ctx context.Context, id int64) (Round, error)

func (*Queries) GetSetting

func (q *Queries) GetSetting(ctx context.Context, key string) ([]byte, error)

func (*Queries) ListCreatablePuzzles

func (q *Queries) ListCreatablePuzzles(ctx context.Context) ([]ListCreatablePuzzlesRow, error)

func (*Queries) ListDiscoveredPuzzlesForRound

func (q *Queries) ListDiscoveredPuzzlesForRound(ctx context.Context, discoveredRound sql.NullInt64) ([]DiscoveredPuzzle, error)

func (*Queries) ListPendingDiscoveredRounds

func (q *Queries) ListPendingDiscoveredRounds(ctx context.Context) ([]DiscoveredRound, error)

func (*Queries) ListPuzzles

func (q *Queries) ListPuzzles(ctx context.Context) ([]ListPuzzlesRow, error)

func (*Queries) ListPuzzlesByRound

func (q *Queries) ListPuzzlesByRound(ctx context.Context, round int64) ([]ListPuzzlesByRoundRow, error)

func (*Queries) ListPuzzlesByVoiceRoom

func (q *Queries) ListPuzzlesByVoiceRoom(ctx context.Context) ([]ListPuzzlesByVoiceRoomRow, error)

func (*Queries) ListRounds

func (q *Queries) ListRounds(ctx context.Context) ([]Round, error)

func (*Queries) UpdateDiscoveredRound

func (q *Queries) UpdateDiscoveredRound(ctx context.Context, arg UpdateDiscoveredRoundParams) error

func (*Queries) UpdatePuzzle

func (q *Queries) UpdatePuzzle(ctx context.Context, arg UpdatePuzzleParams) error

func (*Queries) UpdateRound

func (q *Queries) UpdateRound(ctx context.Context, arg UpdateRoundParams) error

func (*Queries) UpdateSetting

func (q *Queries) UpdateSetting(ctx context.Context, arg UpdateSettingParams) error

func (*Queries) WithTx

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

type Round

type Round struct {
	ID              int64  `json:"id"`
	Name            string `json:"name"`
	Emoji           string `json:"emoji"`
	Hue             int64  `json:"hue"`
	Sort            int64  `json:"sort"`
	Special         bool   `json:"special"`
	DriveFolder     string `json:"drive_folder"`
	DiscordCategory string `json:"discord_category"`
}

type Setting

type Setting struct {
	Key   string `json:"key"`
	Value []byte `json:"value"`
}

type UpdateDiscoveredRoundParams

type UpdateDiscoveredRoundParams struct {
	ID         int64     `json:"id"`
	Name       string    `json:"name"`
	MessageID  string    `json:"message_id"`
	NotifiedAt time.Time `json:"notified_at"`
	CreatedAs  int64     `json:"created_as"`
}

type UpdatePuzzleParams

type UpdatePuzzleParams struct {
	ID             int64         `json:"id"`
	Name           string        `json:"name"`
	Answer         string        `json:"answer"`
	Round          int64         `json:"round"`
	Status         status.Status `json:"status"`
	Note           string        `json:"note"`
	Location       string        `json:"location"`
	PuzzleURL      string        `json:"puzzle_url"`
	SpreadsheetID  string        `json:"spreadsheet_id"`
	DiscordChannel string        `json:"discord_channel"`
	Meta           bool          `json:"meta"`
	VoiceRoom      string        `json:"voice_room"`
	Reminder       time.Time     `json:"reminder"`
}

type UpdateRoundParams

type UpdateRoundParams struct {
	ID              int64  `json:"id"`
	Name            string `json:"name"`
	Emoji           string `json:"emoji"`
	Hue             int64  `json:"hue"`
	Sort            int64  `json:"sort"`
	Special         bool   `json:"special"`
	DriveFolder     string `json:"drive_folder"`
	DiscordCategory string `json:"discord_category"`
}

type UpdateSettingParams

type UpdateSettingParams struct {
	Key   string `json:"key"`
	Value []byte `json:"value"`
}

Jump to

Keyboard shortcuts

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