Documentation ¶
Index ¶
- Variables
- func PSQLGeneratedInsert(model interface{}) string
- func PSQLGeneratedUpdate(model interface{}) string
- func RemoveSliceItem[T any](slice []T, index int) []T
- func SqlGenKeys(model interface{}) string
- type Ability
- type AbilityModel
- func (am *AbilityModel) Delete(id int64) error
- func (am *AbilityModel) Get(id int64) (*Ability, error)
- func (am *AbilityModel) GetAll() ([]Ability, error)
- func (am *AbilityModel) GetAllAnyAbilities() ([]AnyAbility, error)
- func (am *AbilityModel) GetAnyAbility(id int64) (*AnyAbility, error)
- func (am *AbilityModel) GetAnyAbilityByCategory(category string) ([]AnyAbility, error)
- func (am *AbilityModel) GetAnyAbilityByName(name string) (*AnyAbility, error)
- func (am *AbilityModel) GetAnyAbilityByRarity(rarity string) ([]AnyAbility, error)
- func (am *AbilityModel) GetAnyAbilitybyFuzzy(name string) (*AnyAbility, error)
- func (am *AbilityModel) GetByCategory(category string) ([]Ability, error)
- func (am *AbilityModel) GetByFuzzy(name string) (*Ability, error)
- func (am *AbilityModel) GetByName(name string) (*Ability, error)
- func (am *AbilityModel) GetByRarity(rarity string) ([]Ability, error)
- func (am *AbilityModel) GetRandomAnyAbilityByRarity(rarity string) (*AnyAbility, error)
- func (am *AbilityModel) GetRandomByRarity(rarity string) (*Ability, error)
- func (am *AbilityModel) Insert(a *Ability) (int64, error)
- func (am *AbilityModel) InsertAnyAbility(aa *AnyAbility) error
- func (am *AbilityModel) Update(a *Ability) error
- func (am *AbilityModel) UpdateAnyAbility(aa *AnyAbility) error
- func (am *AbilityModel) Upsert(a *Ability) error
- func (am *AbilityModel) WipeTable() error
- type Action
- type ActionModel
- type Alliance
- type AllianceInvite
- type AllianceModel
- func (am *AllianceModel) Delete(alliance *Alliance) error
- func (am *AllianceModel) DeleteInvite(invite *AllianceInvite) error
- func (am AllianceModel) DeleteInviteByInviteeIDAndInviterID(inviteeID, inviterID string) error
- func (am *AllianceModel) DeleteRequest(req *AllianceRequest) error
- func (ah *AllianceModel) DeleteRequestByName(name string) error
- func (am *AllianceModel) GetAllByMemberID(discordID string) ([]Alliance, error)
- func (am *AllianceModel) GetAllInvites() ([]AllianceInvite, error)
- func (am *AllianceModel) GetAllInvitesForUser(userID string) ([]AllianceInvite, error)
- func (am *AllianceModel) GetAllRequests() ([]AllianceRequest, error)
- func (am *AllianceModel) GetAlliances() ([]Alliance, error)
- func (am *AllianceModel) GetByMemberID(discordID string) (*Alliance, error)
- func (am *AllianceModel) GetByName(name string) (*Alliance, error)
- func (am *AllianceModel) GetInviteByInviteeIDAndAllianceName(inviteeID, allianceName string) (*AllianceInvite, error)
- func (am *AllianceModel) GetInviteByInviteeIDAndInviterID(inviteeID, inviterID string) (*AllianceInvite, error)
- func (am *AllianceModel) GetInvitesByAllianceName(allianceName string) ([]AllianceInvite, error)
- func (am *AllianceModel) GetRequestByName(name string) (*AllianceRequest, error)
- func (am *AllianceModel) GetRequestByRequesterID(name string) (*AllianceRequest, error)
- func (am *AllianceModel) Insert(alliance *Alliance) error
- func (am *AllianceModel) InsertInvite(invite *AllianceInvite) error
- func (am *AllianceModel) InsertMember(alliance *Alliance) error
- func (am *AllianceModel) InsertRequest(req *AllianceRequest) error
- func (am *AllianceModel) UpdateAllianceMembers(alliance *Alliance) error
- func (am *AllianceModel) UpdateInviteInviteeAccepted(invite *AllianceInvite) error
- type AllianceRequest
- type AnyAbility
- type FunnelChannel
- type FunnelChannelModel
- type Hitlist
- type HitlistModel
- type Insult
- type InsultModel
- type Inventory
- type InventoryCronJob
- type InventoryCronJobModel
- func (icjm *InventoryCronJobModel) DeleteByID(id int) error
- func (icjm *InventoryCronJobModel) DeleteByInventoryID(inventoryID string) error
- func (icjm *InventoryCronJobModel) DeletebyJobID(jobID string) error
- func (icjm *InventoryCronJobModel) ExtendInvokeTime(time int64) error
- func (cjm *InventoryCronJobModel) GetAll() (*InventoryCronJob, error)
- func (cjm *InventoryCronJobModel) GetByCategory(category string) ([]InventoryCronJob, error)
- func (icjm *InventoryCronJobModel) GetByInventoryID(inventoryID string) ([]InventoryCronJob, error)
- func (icjm *InventoryCronJobModel) GetByJobID(jobID string) (*InventoryCronJob, error)
- func (icjm *InventoryCronJobModel) Insert(icj *InventoryCronJob) error
- func (icjm *InventoryCronJobModel) Upsert(icj *InventoryCronJob) error
- type InventoryModel
- func (m *InventoryModel) Delete(discordID string) error
- func (m *InventoryModel) GetAll() ([]Inventory, error)
- func (m *InventoryModel) GetAllActiveRoleNames() ([]string, error)
- func (m *InventoryModel) GetAllPlayerIDs() ([]string, error)
- func (m *InventoryModel) GetByDiscordID(discordID string) (*Inventory, error)
- func (m *InventoryModel) GetByPinChannel(pinChannel string) (*Inventory, error)
- func (m *InventoryModel) Insert(i *Inventory) (int64, error)
- func (m *InventoryModel) Update(inventory *Inventory) error
- func (m *InventoryModel) UpdateAbilities(inventory *Inventory) error
- func (m *InventoryModel) UpdateAnyAbilities(inventory *Inventory) error
- func (m *InventoryModel) UpdateCoinBonus(inventory *Inventory) error
- func (m *InventoryModel) UpdateCoins(inventory *Inventory) error
- func (m *InventoryModel) UpdateEffects(inventory *Inventory) error
- func (m *InventoryModel) UpdateImmunities(inventory *Inventory) error
- func (m *InventoryModel) UpdateItemLimit(inventory *Inventory) error
- func (m *InventoryModel) UpdateItems(inventory *Inventory) error
- func (m *InventoryModel) UpdateLuck(inventory *Inventory) error
- func (m *InventoryModel) UpdateNotes(inventory *Inventory) error
- func (m *InventoryModel) UpdatePerks(inventory *Inventory) error
- func (m *InventoryModel) UpdateProperty(inventory *Inventory, columnName string, value interface{}) error
- func (m *InventoryModel) UpdateStatuses(inventory *Inventory) error
- type Item
- type ItemModel
- func (im *ItemModel) Delete(id int64) error
- func (im *ItemModel) Get(id int64) (*Item, error)
- func (im *ItemModel) GetAll() ([]Item, error)
- func (im *ItemModel) GetByFuzzy(name string) (*Item, error)
- func (im *ItemModel) GetByName(name string) (*Item, error)
- func (im *ItemModel) GetByRarity(rarity string) ([]Item, error)
- func (im *ItemModel) GetRandomByRarity(rarity string) (*Item, error)
- func (im *ItemModel) Insert(i *Item) (int64, error)
- func (im *ItemModel) Update(item *Item) error
- type Models
- type Perk
- type PerkModel
- func (pm *PerkModel) Delete(id int64) error
- func (pm *PerkModel) Get(id int64) (*Perk, error)
- func (pm *PerkModel) GetAll() ([]Perk, error)
- func (pm *PerkModel) GetByFuzzy(name string) (*Perk, error)
- func (pm *PerkModel) GetByName(name string) (*Perk, error)
- func (pm *PerkModel) Insert(p *Perk) (int64, error)
- func (pm *PerkModel) Update(p *Perk) error
- func (p *PerkModel) UpdateName(perk *Perk) error
- func (pm *PerkModel) Upsert(p *Perk) error
- type Role
- type RoleList
- type RoleListModel
- type RoleModel
- func (rm *RoleModel) Delete(id int64) error
- func (rm *RoleModel) Get(id int64) (*Role, error)
- func (rm *RoleModel) GetAbilities(roleID int64) ([]*Ability, error)
- func (rm *RoleModel) GetAll() ([]*Role, error)
- func (rm *RoleModel) GetAllByAbilityID(abilityID int64) ([]Role, error)
- func (rm *RoleModel) GetAllByID(ids []int64) ([]*Role, error)
- func (rm *RoleModel) GetAllByPerkID(p *Perk) ([]Role, error)
- func (rm *RoleModel) GetAllNames() ([]string, error)
- func (rm *RoleModel) GetBulkByName(names pq.StringArray) ([]*Role, error)
- func (rm *RoleModel) GetByAbilityID(abilityID int64) (*Role, error)
- func (rm *RoleModel) GetByFuzzy(name string) (*Role, error)
- func (rm *RoleModel) GetByName(name string) (*Role, error)
- func (rm *RoleModel) GetByPerkID(perkID int64) (*Role, error)
- func (rm *RoleModel) GetPerks(RoleID int64) ([]*Perk, error)
- func (rm *RoleModel) Insert(r *Role) (int64, error)
- func (rm *RoleModel) InsertJoinAbility(roleID int64, abilityID int64) error
- func (rm *RoleModel) InsertJoinPerk(roleID int64, perkID int64) error
- func (rm *RoleModel) Update(r *Role) error
- func (rm *RoleModel) Upsert(r *Role) error
- func (rm *RoleModel) WipeTable() error
- type Status
- type StatusModel
- func (sm *StatusModel) Delete(id int64) error
- func (sm *StatusModel) Get(id int64) (*Status, error)
- func (sm *StatusModel) GetAll() ([]Status, error)
- func (sm *StatusModel) GetByFuzzy(name string) (*Status, error)
- func (sm *StatusModel) GetByName(name string) (*Status, error)
- func (sm *StatusModel) Insert(s *Status) (int64, error)
- func (sm *StatusModel) Update(status *Status) error
- func (sm *StatusModel) Upsert(s *Status) error
- type Vote
- type VoteModel
- type Whitelist
- type WhitelistModel
Constants ¶
This section is empty.
Variables ¶
var ( ErrRecordNotFound = errors.New("record not found") ErrRecordAlreadyExists = errors.New("record already exists") )
Functions ¶
func PSQLGeneratedInsert ¶
func PSQLGeneratedInsert(model interface{}) string
Function to generate an SQLX insert statement with placeholders i.e for query INSERT INTO table (column1, column2...) VALUES (:column1, :column2...) Will check if default field value is not nil/empty before adding to query
func PSQLGeneratedUpdate ¶
func PSQLGeneratedUpdate(model interface{}) string
func RemoveSliceItem ¶
Idk where tf to put this thing so its getting thrown in here for now
func SqlGenKeys ¶
func SqlGenKeys(model interface{}) string
Helper to automatically generate the PSQL query for the keys of a struct
Types ¶
type Ability ¶
type Ability struct { ID int64 `db:"id" json:"id"` Name string `db:"name" json:"name"` Description string `db:"description" json:"description"` Categories pq.StringArray `db:"categories" json:"categories"` Charges int `db:"charges" json:"charges"` AnyAbility bool `db:"any_ability" json:"any_ability"` Rarity string `db:"rarity" json:"rarity"` CreatedAt string `db:"created_at" json:"created_at"` }
Ability that is role specific.
type AbilityModel ¶
func (*AbilityModel) Delete ¶
func (am *AbilityModel) Delete(id int64) error
func (*AbilityModel) GetAll ¶
func (am *AbilityModel) GetAll() ([]Ability, error)
func (*AbilityModel) GetAllAnyAbilities ¶
func (am *AbilityModel) GetAllAnyAbilities() ([]AnyAbility, error)
func (*AbilityModel) GetAnyAbility ¶
func (am *AbilityModel) GetAnyAbility(id int64) (*AnyAbility, error)
func (*AbilityModel) GetAnyAbilityByCategory ¶
func (am *AbilityModel) GetAnyAbilityByCategory(category string) ([]AnyAbility, error)
func (*AbilityModel) GetAnyAbilityByName ¶
func (am *AbilityModel) GetAnyAbilityByName(name string) (*AnyAbility, error)
func (*AbilityModel) GetAnyAbilityByRarity ¶
func (am *AbilityModel) GetAnyAbilityByRarity(rarity string) ([]AnyAbility, error)
func (*AbilityModel) GetAnyAbilitybyFuzzy ¶
func (am *AbilityModel) GetAnyAbilitybyFuzzy(name string) (*AnyAbility, error)
func (*AbilityModel) GetByCategory ¶
func (am *AbilityModel) GetByCategory(category string) ([]Ability, error)
func (*AbilityModel) GetByFuzzy ¶
func (am *AbilityModel) GetByFuzzy(name string) (*Ability, error)
func (*AbilityModel) GetByRarity ¶
func (am *AbilityModel) GetByRarity(rarity string) ([]Ability, error)
func (*AbilityModel) GetRandomAnyAbilityByRarity ¶
func (am *AbilityModel) GetRandomAnyAbilityByRarity(rarity string) (*AnyAbility, error)
func (*AbilityModel) GetRandomByRarity ¶
func (am *AbilityModel) GetRandomByRarity(rarity string) (*Ability, error)
func (*AbilityModel) InsertAnyAbility ¶
func (am *AbilityModel) InsertAnyAbility(aa *AnyAbility) error
func (*AbilityModel) Update ¶
func (am *AbilityModel) Update(a *Ability) error
func (*AbilityModel) UpdateAnyAbility ¶
func (am *AbilityModel) UpdateAnyAbility(aa *AnyAbility) error
func (*AbilityModel) Upsert ¶
func (am *AbilityModel) Upsert(a *Ability) error
func (*AbilityModel) WipeTable ¶
func (am *AbilityModel) WipeTable() error
type Action ¶
type Action struct { ID int64 `db:"id" json:"id"` RequestedAction string `db:"requested_action" json:"requested_action"` RequestedChannelID string `db:"requested_channel_id" json:"requested_channel_id"` RequestedMessageID string `db:"requested_message_id" json:"requested_message_id"` RequesterID string `db:"requester_id" json:"requester_id"` RequestedAt string `db:"requested_at" json:"requested_at"` RequestedDay int64 `db:"requested_day" json:"requested_day"` }
type ActionModel ¶
func (*ActionModel) Update ¶
func (am *ActionModel) Update(action *Action) error
type Alliance ¶
type Alliance struct { ID int `db:"id" json:"id"` Name string `db:"name" json:"name"` ChannelID string `db:"channel_id" json:"channel_id"` MemberIDs pq.StringArray `db:"member_ids" json:"member_ids"` }
type AllianceInvite ¶
type AllianceModel ¶
func (*AllianceModel) Delete ¶
func (am *AllianceModel) Delete(alliance *Alliance) error
Delete any associated invites and requests with the alliance
func (*AllianceModel) DeleteInvite ¶
func (am *AllianceModel) DeleteInvite(invite *AllianceInvite) error
func (AllianceModel) DeleteInviteByInviteeIDAndInviterID ¶
func (am AllianceModel) DeleteInviteByInviteeIDAndInviterID(inviteeID, inviterID string) error
func (*AllianceModel) DeleteRequest ¶
func (am *AllianceModel) DeleteRequest(req *AllianceRequest) error
func (*AllianceModel) DeleteRequestByName ¶
func (ah *AllianceModel) DeleteRequestByName(name string) error
func (*AllianceModel) GetAllByMemberID ¶
func (am *AllianceModel) GetAllByMemberID(discordID string) ([]Alliance, error)
func (*AllianceModel) GetAllInvites ¶
func (am *AllianceModel) GetAllInvites() ([]AllianceInvite, error)
func (*AllianceModel) GetAllInvitesForUser ¶
func (am *AllianceModel) GetAllInvitesForUser(userID string) ([]AllianceInvite, error)
func (*AllianceModel) GetAllRequests ¶
func (am *AllianceModel) GetAllRequests() ([]AllianceRequest, error)
func (*AllianceModel) GetAlliances ¶
func (am *AllianceModel) GetAlliances() ([]Alliance, error)
func (*AllianceModel) GetByMemberID ¶
func (am *AllianceModel) GetByMemberID(discordID string) (*Alliance, error)
func (*AllianceModel) GetByName ¶
func (am *AllianceModel) GetByName(name string) (*Alliance, error)
func (*AllianceModel) GetInviteByInviteeIDAndAllianceName ¶
func (am *AllianceModel) GetInviteByInviteeIDAndAllianceName(inviteeID, allianceName string) (*AllianceInvite, error)
func (*AllianceModel) GetInviteByInviteeIDAndInviterID ¶
func (am *AllianceModel) GetInviteByInviteeIDAndInviterID(inviteeID, inviterID string) (*AllianceInvite, error)
func (*AllianceModel) GetInvitesByAllianceName ¶
func (am *AllianceModel) GetInvitesByAllianceName(allianceName string) ([]AllianceInvite, error)
func (*AllianceModel) GetRequestByName ¶
func (am *AllianceModel) GetRequestByName(name string) (*AllianceRequest, error)
func (*AllianceModel) GetRequestByRequesterID ¶
func (am *AllianceModel) GetRequestByRequesterID(name string) (*AllianceRequest, error)
func (*AllianceModel) Insert ¶
func (am *AllianceModel) Insert(alliance *Alliance) error
func (*AllianceModel) InsertInvite ¶
func (am *AllianceModel) InsertInvite(invite *AllianceInvite) error
func (*AllianceModel) InsertMember ¶
func (am *AllianceModel) InsertMember(alliance *Alliance) error
func (*AllianceModel) InsertRequest ¶
func (am *AllianceModel) InsertRequest(req *AllianceRequest) error
func (*AllianceModel) UpdateAllianceMembers ¶
func (am *AllianceModel) UpdateAllianceMembers(alliance *Alliance) error
func (*AllianceModel) UpdateInviteInviteeAccepted ¶
func (am *AllianceModel) UpdateInviteInviteeAccepted(invite *AllianceInvite) error
type AllianceRequest ¶
type AnyAbility ¶
type AnyAbility struct { ID int64 `db:"id" json:"id"` Name string `db:"name" json:"name"` Description string `db:"description" json:"description"` Categories pq.StringArray `db:"categories" json:"categories"` Rarity string `db:"rarity" json:"rarity"` // Name of the role that this ability is specific to. If empty, it is not specific to any role. RoleSpecific string `db:"role_specific"` }
Ability that can be rolled in AA events
type FunnelChannel ¶
type FunnelChannelModel ¶
func (*FunnelChannelModel) Get ¶
func (fcm *FunnelChannelModel) Get(guildID string) (*FunnelChannel, error)
func (*FunnelChannelModel) Insert ¶
func (fcm *FunnelChannelModel) Insert(funnelChannel *FunnelChannel) (int64, error)
func (*FunnelChannelModel) Remove ¶
func (fcm *FunnelChannelModel) Remove(guildID string) error
type HitlistModel ¶
func (*HitlistModel) Delete ¶
func (hl *HitlistModel) Delete(id int64) error
func (*HitlistModel) Get ¶
func (hl *HitlistModel) Get() (*Hitlist, error)
type InsultModel ¶
func (*InsultModel) DeleteInsult ¶
func (im *InsultModel) DeleteInsult(i *Insult) error
func (*InsultModel) GetRandom ¶
func (im *InsultModel) GetRandom() (*Insult, error)
func (*InsultModel) Insert ¶
func (im *InsultModel) Insert(i *Insult) error
type Inventory ¶
type Inventory struct { ID int64 `db:"id" json:"id"` DiscordID string `db:"discord_id" json:"discord_id"` UserPinChannel string `db:"user_pin_channel" json:"user_pin_channel"` UserPinMessage string `db:"user_pin_message" json:"user_pin_message"` RoleName string `db:"role_name" json:"role_name"` Alignment string `db:"alignment" json:"alignment"` Abilities pq.StringArray `db:"abilities" json:"abilities"` AnyAbilities pq.StringArray `db:"any_abilities" json:"any_abilities"` Statuses pq.StringArray `db:"statuses" json:"statuses"` Immunities pq.StringArray `db:"immunities" json:"immunities"` Effects pq.StringArray `db:"effects" json:"effects"` Items pq.StringArray `db:"items" json:"items"` ItemLimit int `db:"item_limit" json:"item_limit"` Perks pq.StringArray `db:"perks" json:"perks"` IsAlive bool `db:"is_alive" json:"is_alive"` Coins int64 `db:"coins" json:"coins"` CoinBonus float32 `db:"coin_bonus" json:"coin_bonus"` Luck int64 `db:"luck" json:"luck"` Notes pq.StringArray `db:"notes" json:"notes"` CreatedAt string `db:"created_at" json:"created_at"` }
type InventoryCronJob ¶
type InventoryCronJob struct { ID int `db:"id"` // foreign key to Inventory ID InventoryID int64 `db:"inventory_id" json:"inventory_id"` ChannelID string `db:"channel_id" json:"channel_id"` PlayerID string `db:"player_id" json:"player_id"` Category string `db:"category" json:"category"` ActionType string `db:"action_type" json:"action_type"` Value string `db:"value" json:"value"` StartTime int64 `db:"start_time" json:"start_time"` InvokeTime int64 `db:"invoke_time" json:"invoke_time"` }
Metadata is a struct that contains all the metadata for a cron job
func (*InventoryCronJob) MakeJobID ¶
func (icj *InventoryCronJob) MakeJobID() string
MakeJobID returns a unique job ID for the cron job based on the inventory ID, category, action type, and value
type InventoryCronJobModel ¶
func (*InventoryCronJobModel) DeleteByID ¶
func (icjm *InventoryCronJobModel) DeleteByID(id int) error
func (*InventoryCronJobModel) DeleteByInventoryID ¶
func (icjm *InventoryCronJobModel) DeleteByInventoryID(inventoryID string) error
func (*InventoryCronJobModel) DeletebyJobID ¶
func (icjm *InventoryCronJobModel) DeletebyJobID(jobID string) error
func (*InventoryCronJobModel) ExtendInvokeTime ¶
func (icjm *InventoryCronJobModel) ExtendInvokeTime(time int64) error
func (*InventoryCronJobModel) GetAll ¶
func (cjm *InventoryCronJobModel) GetAll() (*InventoryCronJob, error)
func (*InventoryCronJobModel) GetByCategory ¶
func (cjm *InventoryCronJobModel) GetByCategory(category string) ([]InventoryCronJob, error)
func (*InventoryCronJobModel) GetByInventoryID ¶
func (icjm *InventoryCronJobModel) GetByInventoryID(inventoryID string) ([]InventoryCronJob, error)
func (*InventoryCronJobModel) GetByJobID ¶
func (icjm *InventoryCronJobModel) GetByJobID(jobID string) (*InventoryCronJob, error)
func (*InventoryCronJobModel) Insert ¶
func (icjm *InventoryCronJobModel) Insert(icj *InventoryCronJob) error
func (*InventoryCronJobModel) Upsert ¶
func (icjm *InventoryCronJobModel) Upsert(icj *InventoryCronJob) error
Upsert will insert or update the cron job based on the job ID
type InventoryModel ¶
func (*InventoryModel) Delete ¶
func (m *InventoryModel) Delete(discordID string) error
func (*InventoryModel) GetAll ¶
func (m *InventoryModel) GetAll() ([]Inventory, error)
func (*InventoryModel) GetAllActiveRoleNames ¶
func (m *InventoryModel) GetAllActiveRoleNames() ([]string, error)
func (*InventoryModel) GetAllPlayerIDs ¶
func (m *InventoryModel) GetAllPlayerIDs() ([]string, error)
func (*InventoryModel) GetByDiscordID ¶
func (m *InventoryModel) GetByDiscordID(discordID string) (*Inventory, error)
func (*InventoryModel) GetByPinChannel ¶
func (m *InventoryModel) GetByPinChannel(pinChannel string) (*Inventory, error)
func (*InventoryModel) Update ¶
func (m *InventoryModel) Update(inventory *Inventory) error
func (*InventoryModel) UpdateAbilities ¶
func (m *InventoryModel) UpdateAbilities(inventory *Inventory) error
func (*InventoryModel) UpdateAnyAbilities ¶
func (m *InventoryModel) UpdateAnyAbilities(inventory *Inventory) error
Overwrites the entire abilities column with the new abilities
func (*InventoryModel) UpdateCoinBonus ¶
func (m *InventoryModel) UpdateCoinBonus(inventory *Inventory) error
func (*InventoryModel) UpdateCoins ¶
func (m *InventoryModel) UpdateCoins(inventory *Inventory) error
func (*InventoryModel) UpdateEffects ¶
func (m *InventoryModel) UpdateEffects(inventory *Inventory) error
func (*InventoryModel) UpdateImmunities ¶
func (m *InventoryModel) UpdateImmunities(inventory *Inventory) error
func (*InventoryModel) UpdateItemLimit ¶
func (m *InventoryModel) UpdateItemLimit(inventory *Inventory) error
func (*InventoryModel) UpdateItems ¶
func (m *InventoryModel) UpdateItems(inventory *Inventory) error
func (*InventoryModel) UpdateLuck ¶
func (m *InventoryModel) UpdateLuck(inventory *Inventory) error
func (*InventoryModel) UpdateNotes ¶
func (m *InventoryModel) UpdateNotes(inventory *Inventory) error
func (*InventoryModel) UpdatePerks ¶
func (m *InventoryModel) UpdatePerks(inventory *Inventory) error
func (*InventoryModel) UpdateProperty ¶
func (m *InventoryModel) UpdateProperty( inventory *Inventory, columnName string, value interface{}, ) error
func (*InventoryModel) UpdateStatuses ¶
func (m *InventoryModel) UpdateStatuses(inventory *Inventory) error
type Item ¶
type Item struct { ID int64 `db:"id" json:"id"` Name string `db:"name" json:"name"` Description string `db:"description" json:"description"` Cost int64 `db:"cost" json:"cost"` Rarity string `db:"rarity" json:"rarity"` Categories pq.StringArray `db:"categories" json:"categories"` CreatedAt string `db:"created_at" json:"created_at"` }
type ItemModel ¶
func (*ItemModel) GetRandomByRarity ¶
type Models ¶
type Models struct { Roles RoleModel Insults InsultModel Abilities AbilityModel Perks PerkModel Statuses StatusModel Items ItemModel Inventories InventoryModel Whitelists WhitelistModel Actions ActionModel FunnelChannels FunnelChannelModel Votes VoteModel RoleLists RoleListModel Hitlists HitlistModel Alliances AllianceModel InventoryCronJobs InventoryCronJobModel }
All interested models to be used in the application
type PerkModel ¶
func (*PerkModel) UpdateName ¶
type Role ¶
type Role struct { ID int64 `db:"id" json:"id"` Name string `db:"name" json:"name"` Description string `db:"description" json:"description"` Alignment string `db:"alignment" json:"alignment"` CreatedAt string `db:"created_at" json:"created_at"` }
How roles are stored in the database.
type RoleList ¶
type RoleList struct { ID int `db:"id" json:"id"` Roles pq.StringArray `db:"roles" json:"roles"` }
type RoleListModel ¶
func (*RoleListModel) Delete ¶
func (r *RoleListModel) Delete(roleList RoleList) error
func (*RoleListModel) Get ¶
func (r *RoleListModel) Get() (*RoleList, error)
func (*RoleListModel) Insert ¶
func (r *RoleListModel) Insert(roleList RoleList) error
func (*RoleListModel) Update ¶
func (r *RoleListModel) Update(roleList RoleList) error
type RoleModel ¶
func (*RoleModel) GetAbilities ¶
func (*RoleModel) GetAllByAbilityID ¶
func (*RoleModel) GetAllNames ¶
func (*RoleModel) GetBulkByName ¶
func (rm *RoleModel) GetBulkByName(names pq.StringArray) ([]*Role, error)
func (*RoleModel) GetByAbilityID ¶
func (*RoleModel) InsertJoinAbility ¶
func (*RoleModel) InsertJoinPerk ¶
type StatusModel ¶
func (*StatusModel) Delete ¶
func (sm *StatusModel) Delete(id int64) error
func (*StatusModel) GetAll ¶
func (sm *StatusModel) GetAll() ([]Status, error)
func (*StatusModel) GetByFuzzy ¶
func (sm *StatusModel) GetByFuzzy(name string) (*Status, error)
func (*StatusModel) Update ¶
func (sm *StatusModel) Update(status *Status) error
func (*StatusModel) Upsert ¶
func (sm *StatusModel) Upsert(s *Status) error
type WhitelistModel ¶
func (*WhitelistModel) Delete ¶
func (w *WhitelistModel) Delete(whitelist *Whitelist) (err error)
func (*WhitelistModel) GetAll ¶
func (w *WhitelistModel) GetAll() (whitelists []*Whitelist, err error)
func (*WhitelistModel) GetByChannelName ¶
func (w *WhitelistModel) GetByChannelName(channelName string) (whitelist *Whitelist, err error)
func (*WhitelistModel) Insert ¶
func (w *WhitelistModel) Insert(whitelist *Whitelist) (err error)