models

package
v0.0.0-...-ac64c08 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbilityDetail

type AbilityDetail struct {
	ID             int32       `json:"id"`
	Name           string      `json:"name"`
	Description    string      `json:"description"`
	DefaultCharges pgtype.Int4 `json:"default_charges"`
	Rarity         Rarity      `json:"rarity"`
	AnyAbility     pgtype.Bool `json:"any_ability"`
}

type AbilityDetailsCategoriesJoin

type AbilityDetailsCategoriesJoin struct {
	AbilityDetailsID int32 `json:"ability_details_id"`
	CategoriesID     int32 `json:"categories_id"`
}

type Alignment

type Alignment string
const (
	AlignmentLAWFUL    Alignment = "LAWFUL"
	AlignmentOUTLANDER Alignment = "OUTLANDER"
	AlignmentCHAOTIC   Alignment = "CHAOTIC"
)

func (*Alignment) Scan

func (e *Alignment) Scan(src interface{}) error

type Category

type Category struct {
	ID       int32       `json:"id"`
	Name     pgtype.Text `json:"name"`
	Priority pgtype.Int4 `json:"priority"`
}

type CreateAbilityDetailParams

type CreateAbilityDetailParams struct {
	Name           string      `json:"name"`
	Description    string      `json:"description"`
	DefaultCharges pgtype.Int4 `json:"default_charges"`
	AnyAbility     pgtype.Bool `json:"any_ability"`
	Rarity         Rarity      `json:"rarity"`
}

type CreateAbilityDetailsCategoriesJoinParams

type CreateAbilityDetailsCategoriesJoinParams struct {
	AbilityDetailsID int32 `json:"ability_details_id"`
	CategoriesID     int32 `json:"categories_id"`
}

type CreateGameParams

type CreateGameParams struct {
	Name      string  `json:"name"`
	Phase     string  `json:"phase"`
	Round     int32   `json:"round"`
	PlayerIds []int32 `json:"player_ids"`
}

type CreatePassiveDetailParams

type CreatePassiveDetailParams struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type CreatePlayerAbilityParams

type CreatePlayerAbilityParams struct {
	PlayerID         int32 `json:"player_id"`
	AbilityDetailsID int32 `json:"ability_details_id"`
	Charges          int32 `json:"charges"`
}

type CreatePlayerParams

type CreatePlayerParams struct {
	Name      string        `json:"name"`
	GameID    pgtype.Int4   `json:"game_id"`
	RoleID    pgtype.Int4   `json:"role_id"`
	Alive     bool          `json:"alive"`
	Alignment NullAlignment `json:"alignment"`
	RoomID    pgtype.Int4   `json:"room_id"`
}

type CreatePlayerStatusParams

type CreatePlayerStatusParams struct {
	PlayerID   int32 `json:"player_id"`
	StatusID   int32 `json:"status_id"`
	Stack      int32 `json:"stack"`
	RoundGiven int32 `json:"round_given"`
}

type CreateRoleAbilityJoinParams

type CreateRoleAbilityJoinParams struct {
	RoleID    int32 `json:"role_id"`
	AbilityID int32 `json:"ability_id"`
}

type CreateRoleParams

type CreateRoleParams struct {
	Name      string    `json:"name"`
	Alignment Alignment `json:"alignment"`
}

type CreateRolePassiveJoinParams

type CreateRolePassiveJoinParams struct {
	RoleID    int32 `json:"role_id"`
	PassiveID int32 `json:"passive_id"`
}

type CreateStatusDetailParams

type CreateStatusDetailParams struct {
	Name        string      `json:"name"`
	Description pgtype.Text `json:"description"`
}

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 DeletePlayerAbilityParams

type DeletePlayerAbilityParams struct {
	PlayerID         int32 `json:"player_id"`
	AbilityDetailsID int32 `json:"ability_details_id"`
}

type Game

type Game struct {
	ID        int32            `json:"id"`
	Name      string           `json:"name"`
	Phase     string           `json:"phase"`
	Round     int32            `json:"round"`
	PlayerIds []int32          `json:"player_ids"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type GetPlayerAbilityParams

type GetPlayerAbilityParams struct {
	PlayerID         int32 `json:"player_id"`
	AbilityDetailsID int32 `json:"ability_details_id"`
}

type GetPlayerAbilityRow

type GetPlayerAbilityRow struct {
	AbilityDetailsID int32       `json:"ability_details_id"`
	Charges          int32       `json:"charges"`
	Name             string      `json:"name"`
	Description      string      `json:"description"`
	Rarity           Rarity      `json:"rarity"`
	AnyAbility       pgtype.Bool `json:"any_ability"`
}

type GetRolePassiveJoinRow

type GetRolePassiveJoinRow struct {
	RolePassivesJoin RolePassivesJoin `json:"role_passives_join"`
	PassiveDetail    PassiveDetail    `json:"passive_detail"`
}

type GetRolePassivesAggregateRow

type GetRolePassivesAggregateRow struct {
	PassiveNames        interface{} `json:"passive_names"`
	PassiveDescriptions interface{} `json:"passive_descriptions"`
}

type ListCategoryNamesToIDsRow

type ListCategoryNamesToIDsRow struct {
	Name pgtype.Text `json:"name"`
	ID   int32       `json:"id"`
}

type ListPlayerAbilitiesJoinRow

type ListPlayerAbilitiesJoinRow struct {
	AbilityDetailsID int32       `json:"ability_details_id"`
	Charges          int32       `json:"charges"`
	Name             string      `json:"name"`
	Description      string      `json:"description"`
	Rarity           Rarity      `json:"rarity"`
	AnyAbility       pgtype.Bool `json:"any_ability"`
}

type NullAlignment

type NullAlignment struct {
	Alignment Alignment `json:"alignment"`
	Valid     bool      `json:"valid"` // Valid is true if Alignment is not NULL
}

func (*NullAlignment) Scan

func (ns *NullAlignment) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullAlignment) Value

func (ns NullAlignment) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullRarity

type NullRarity struct {
	Rarity Rarity `json:"rarity"`
	Valid  bool   `json:"valid"` // Valid is true if Rarity is not NULL
}

func (*NullRarity) Scan

func (ns *NullRarity) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRarity) Value

func (ns NullRarity) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type PassiveDetail

type PassiveDetail struct {
	ID          int32  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type Player

type Player struct {
	ID        int32         `json:"id"`
	Name      string        `json:"name"`
	GameID    pgtype.Int4   `json:"game_id"`
	RoleID    pgtype.Int4   `json:"role_id"`
	Alive     bool          `json:"alive"`
	Alignment NullAlignment `json:"alignment"`
	RoomID    pgtype.Int4   `json:"room_id"`
}

type PlayerAbility

type PlayerAbility struct {
	PlayerID         int32 `json:"player_id"`
	AbilityDetailsID int32 `json:"ability_details_id"`
	Charges          int32 `json:"charges"`
}

type PlayerNote

type PlayerNote struct {
	PlayerID int32  `json:"player_id"`
	Note     string `json:"note"`
}

type PlayerStatus

type PlayerStatus struct {
	PlayerID   int32 `json:"player_id"`
	StatusID   int32 `json:"status_id"`
	Stack      int32 `json:"stack"`
	RoundGiven int32 `json:"round_given"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateAbilityDetail

func (q *Queries) CreateAbilityDetail(ctx context.Context, arg CreateAbilityDetailParams) (AbilityDetail, error)

func (*Queries) CreateGame

func (q *Queries) CreateGame(ctx context.Context, arg CreateGameParams) (Game, error)

func (*Queries) CreatePassiveDetail

func (q *Queries) CreatePassiveDetail(ctx context.Context, arg CreatePassiveDetailParams) (PassiveDetail, error)

func (*Queries) CreatePlayer

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

func (*Queries) CreatePlayerAbility

func (q *Queries) CreatePlayerAbility(ctx context.Context, arg CreatePlayerAbilityParams) (PlayerAbility, error)

func (*Queries) CreatePlayerStatus

func (q *Queries) CreatePlayerStatus(ctx context.Context, arg CreatePlayerStatusParams) (PlayerStatus, error)

func (*Queries) CreateRole

func (q *Queries) CreateRole(ctx context.Context, arg CreateRoleParams) (Role, error)

func (*Queries) CreateRoleAbilityJoin

func (q *Queries) CreateRoleAbilityJoin(ctx context.Context, arg CreateRoleAbilityJoinParams) (RoleAbilitiesJoin, error)

func (*Queries) CreateRolePassiveJoin

func (q *Queries) CreateRolePassiveJoin(ctx context.Context, arg CreateRolePassiveJoinParams) (RolePassivesJoin, error)

func (*Queries) CreateStatusDetail

func (q *Queries) CreateStatusDetail(ctx context.Context, arg CreateStatusDetailParams) (StatusDetail, error)

func (*Queries) DeleteAbilityDetail

func (q *Queries) DeleteAbilityDetail(ctx context.Context, id int32) error

func (*Queries) DeleteGame

func (q *Queries) DeleteGame(ctx context.Context, id int32) error

func (*Queries) DeletePassiveDetail

func (q *Queries) DeletePassiveDetail(ctx context.Context, id int32) error

func (*Queries) DeletePlayer

func (q *Queries) DeletePlayer(ctx context.Context, id int32) error

func (*Queries) DeletePlayerAbility

func (q *Queries) DeletePlayerAbility(ctx context.Context, arg DeletePlayerAbilityParams) error

func (*Queries) DeletePlayerNote

func (q *Queries) DeletePlayerNote(ctx context.Context, playerID int32) error

func (*Queries) GetAbilityDetail

func (q *Queries) GetAbilityDetail(ctx context.Context, id int32) (AbilityDetail, error)

func (*Queries) GetAbilityDetailsByName

func (q *Queries) GetAbilityDetailsByName(ctx context.Context, name string) (AbilityDetail, error)

func (*Queries) GetAllAbilityDetailsByAnyAbility

func (q *Queries) GetAllAbilityDetailsByAnyAbility(ctx context.Context, anyAbility pgtype.Bool) ([]AbilityDetail, error)

func (*Queries) GetAllPassiveDetails

func (q *Queries) GetAllPassiveDetails(ctx context.Context) ([]PassiveDetail, error)

func (*Queries) GetAllPassiveDetailsByID

func (q *Queries) GetAllPassiveDetailsByID(ctx context.Context, id int32) ([]PassiveDetail, error)

func (*Queries) GetAllPlayers

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

func (*Queries) GetAnyAbilityDetailsMarkedAnyAbility

func (q *Queries) GetAnyAbilityDetailsMarkedAnyAbility(ctx context.Context) ([]AbilityDetail, error)

func (*Queries) GetAssociatedRolePassives

func (q *Queries) GetAssociatedRolePassives(ctx context.Context, roleID int32) ([]PassiveDetail, error)

func (*Queries) GetCategoriesForAbilityByID

func (q *Queries) GetCategoriesForAbilityByID(ctx context.Context) ([]Category, error)

func (*Queries) GetCategoryByID

func (q *Queries) GetCategoryByID(ctx context.Context, id int32) (Category, error)

func (*Queries) GetCategoryByName

func (q *Queries) GetCategoryByName(ctx context.Context, name pgtype.Text) (Category, error)

func (*Queries) GetCategoryIDByName

func (q *Queries) GetCategoryIDByName(ctx context.Context, name pgtype.Text) (int32, error)

func (*Queries) GetGame

func (q *Queries) GetGame(ctx context.Context, id int32) (Game, error)

func (*Queries) GetGameByName

func (q *Queries) GetGameByName(ctx context.Context, name string) (Game, error)

func (*Queries) GetPassiveDetails

func (q *Queries) GetPassiveDetails(ctx context.Context, id int32) (PassiveDetail, error)

func (*Queries) GetPassiveDetailsByName

func (q *Queries) GetPassiveDetailsByName(ctx context.Context, name string) (PassiveDetail, error)

func (*Queries) GetPlayer

func (q *Queries) GetPlayer(ctx context.Context, id int32) (Player, error)

func (*Queries) GetPlayerAbility

func (q *Queries) GetPlayerAbility(ctx context.Context, arg GetPlayerAbilityParams) (GetPlayerAbilityRow, error)

func (*Queries) GetPlayerByID

func (q *Queries) GetPlayerByID(ctx context.Context, id int32) (Player, error)

func (*Queries) GetPlayerByName

func (q *Queries) GetPlayerByName(ctx context.Context, name string) (Player, error)

func (*Queries) GetPlayerNote

func (q *Queries) GetPlayerNote(ctx context.Context, playerID int32) (PlayerNote, error)

func (*Queries) GetRandomGame

func (q *Queries) GetRandomGame(ctx context.Context) (Game, error)

func (*Queries) GetRole

func (q *Queries) GetRole(ctx context.Context, id int32) (Role, error)

func (*Queries) GetRoleAbilityDetails

func (q *Queries) GetRoleAbilityDetails(ctx context.Context, roleID int32) ([]AbilityDetail, error)

func (*Queries) GetRoleFromAbilityDetailsID

func (q *Queries) GetRoleFromAbilityDetailsID(ctx context.Context, abilityID int32) (Role, error)

func (*Queries) GetRolePassiveDetails

func (q *Queries) GetRolePassiveDetails(ctx context.Context, roleID int32) ([]PassiveDetail, error)

func (*Queries) GetRolePassiveJoin

func (q *Queries) GetRolePassiveJoin(ctx context.Context) (GetRolePassiveJoinRow, error)

func (*Queries) GetRolePassivesAggregate

func (q *Queries) GetRolePassivesAggregate(ctx context.Context, id int32) (GetRolePassivesAggregateRow, error)

func (*Queries) GetRoom

func (q *Queries) GetRoom(ctx context.Context, id int32) (Room, error)

func (*Queries) GetRoomByID

func (q *Queries) GetRoomByID(ctx context.Context, id int32) (Room, error)

func (*Queries) GetRoomBynName

func (q *Queries) GetRoomBynName(ctx context.Context, name string) (Room, error)

func (*Queries) GetStatusDetail

func (q *Queries) GetStatusDetail(ctx context.Context, id int32) (StatusDetail, error)

func (*Queries) GetStatusDetailByID

func (q *Queries) GetStatusDetailByID(ctx context.Context, id int32) (StatusDetail, error)

func (*Queries) GetStatusDetailByName

func (q *Queries) GetStatusDetailByName(ctx context.Context, name string) (StatusDetail, error)

func (*Queries) ListAbilityDetails

func (q *Queries) ListAbilityDetails(ctx context.Context) ([]AbilityDetail, error)

func (*Queries) ListCategories

func (q *Queries) ListCategories(ctx context.Context) ([]Category, error)

func (*Queries) ListCategoryNamesToIDs

func (q *Queries) ListCategoryNamesToIDs(ctx context.Context, name pgtype.Text) ([]ListCategoryNamesToIDsRow, error)

func (*Queries) ListGames

func (q *Queries) ListGames(ctx context.Context) ([]Game, error)

func (*Queries) ListPlayerAbilites

func (q *Queries) ListPlayerAbilites(ctx context.Context, playerID int32) (PlayerAbility, error)

func (*Queries) ListPlayerAbilitiesJoin

func (q *Queries) ListPlayerAbilitiesJoin(ctx context.Context, playerID int32) ([]ListPlayerAbilitiesJoinRow, error)

func (*Queries) ListPlayers

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

func (*Queries) ListPlayersByGame

func (q *Queries) ListPlayersByGame(ctx context.Context, gameID pgtype.Int4) ([]Player, error)

func (*Queries) ListRoles

func (q *Queries) ListRoles(ctx context.Context) ([]Role, error)

func (*Queries) ListRooms

func (q *Queries) ListRooms(ctx context.Context) ([]Room, error)

func (*Queries) ListStatusDetails

func (q *Queries) ListStatusDetails(ctx context.Context) ([]StatusDetail, error)

func (*Queries) NukeRoles

func (q *Queries) NukeRoles(ctx context.Context) error

func (*Queries) UpdateAbilityDetail

func (q *Queries) UpdateAbilityDetail(ctx context.Context, arg UpdateAbilityDetailParams) (AbilityDetail, error)

func (*Queries) UpdateGame

func (q *Queries) UpdateGame(ctx context.Context, arg UpdateGameParams) (Game, error)

func (*Queries) UpdatePassiveDetail

func (q *Queries) UpdatePassiveDetail(ctx context.Context, arg UpdatePassiveDetailParams) (PassiveDetail, error)

func (*Queries) UpdatePlayer

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

func (*Queries) UpdatePlayerAbility

func (q *Queries) UpdatePlayerAbility(ctx context.Context, arg UpdatePlayerAbilityParams) (PlayerAbility, error)

func (*Queries) UpdatePlayerAlignment

func (q *Queries) UpdatePlayerAlignment(ctx context.Context, arg UpdatePlayerAlignmentParams) (Player, error)

func (*Queries) UpdatePlayerAlive

func (q *Queries) UpdatePlayerAlive(ctx context.Context, arg UpdatePlayerAliveParams) (Player, error)

func (*Queries) UpdatePlayerRole

func (q *Queries) UpdatePlayerRole(ctx context.Context, arg UpdatePlayerRoleParams) (Player, error)

func (*Queries) UpdatePlayerRoom

func (q *Queries) UpdatePlayerRoom(ctx context.Context, arg UpdatePlayerRoomParams) (Player, error)

func (*Queries) UpsertPlayerNote

func (q *Queries) UpsertPlayerNote(ctx context.Context, arg UpsertPlayerNoteParams) (PlayerNote, error)

func (*Queries) WithTx

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

type Rarity

type Rarity string
const (
	RarityCOMMON       Rarity = "COMMON"
	RarityUNCOMMON     Rarity = "UNCOMMON"
	RarityRARE         Rarity = "RARE"
	RarityEPIC         Rarity = "EPIC"
	RarityLEGENDARY    Rarity = "LEGENDARY"
	RarityMYTHICAL     Rarity = "MYTHICAL"
	RarityROLESPECIFIC Rarity = "ROLE_SPECIFIC"
)

func (*Rarity) Scan

func (e *Rarity) Scan(src interface{}) error

type Role

type Role struct {
	ID        int32     `json:"id"`
	Name      string    `json:"name"`
	Alignment Alignment `json:"alignment"`
}

type RoleAbilitiesJoin

type RoleAbilitiesJoin struct {
	RoleID    int32 `json:"role_id"`
	AbilityID int32 `json:"ability_id"`
}

type RolePassivesJoin

type RolePassivesJoin struct {
	RoleID    int32 `json:"role_id"`
	PassiveID int32 `json:"passive_id"`
}

type Room

type Room struct {
	ID          int32  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type StatusDetail

type StatusDetail struct {
	ID          int32       `json:"id"`
	Name        string      `json:"name"`
	Description pgtype.Text `json:"description"`
}

type UpdateAbilityDetailParams

type UpdateAbilityDetailParams struct {
	ID             int32       `json:"id"`
	Name           string      `json:"name"`
	Description    string      `json:"description"`
	DefaultCharges pgtype.Int4 `json:"default_charges"`
	AnyAbility     pgtype.Bool `json:"any_ability"`
}

type UpdateGameParams

type UpdateGameParams struct {
	ID        int32   `json:"id"`
	Name      string  `json:"name"`
	Phase     string  `json:"phase"`
	Round     int32   `json:"round"`
	PlayerIds []int32 `json:"player_ids"`
}

type UpdatePassiveDetailParams

type UpdatePassiveDetailParams struct {
	ID          int32  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type UpdatePlayerAbilityParams

type UpdatePlayerAbilityParams struct {
	PlayerID         int32 `json:"player_id"`
	AbilityDetailsID int32 `json:"ability_details_id"`
	Charges          int32 `json:"charges"`
}

type UpdatePlayerAlignmentParams

type UpdatePlayerAlignmentParams struct {
	ID        int32         `json:"id"`
	Alignment NullAlignment `json:"alignment"`
}

type UpdatePlayerAliveParams

type UpdatePlayerAliveParams struct {
	ID    int32 `json:"id"`
	Alive bool  `json:"alive"`
}

type UpdatePlayerParams

type UpdatePlayerParams struct {
	ID        int32         `json:"id"`
	Name      string        `json:"name"`
	GameID    pgtype.Int4   `json:"game_id"`
	RoleID    pgtype.Int4   `json:"role_id"`
	Alive     bool          `json:"alive"`
	Alignment NullAlignment `json:"alignment"`
	RoomID    pgtype.Int4   `json:"room_id"`
}

type UpdatePlayerRoleParams

type UpdatePlayerRoleParams struct {
	ID     int32       `json:"id"`
	RoleID pgtype.Int4 `json:"role_id"`
}

type UpdatePlayerRoomParams

type UpdatePlayerRoomParams struct {
	ID     int32       `json:"id"`
	RoomID pgtype.Int4 `json:"room_id"`
}

type UpsertPlayerNoteParams

type UpsertPlayerNoteParams struct {
	PlayerID int32  `json:"player_id"`
	Note     string `json:"note"`
}

Jump to

Keyboard shortcuts

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