Documentation ¶
Index ¶
- Constants
- func GenerateAPIKey() (string, string, error)
- func GenerateID() string
- func GetAbility(char Character, ability string) int
- func GetFortitude(char Character) int
- func GetReflexes(char Character) int
- func GetWill(char Character) int
- func IsIDUnique(tx *gorm.DB, model interface{}, id string) bool
- func IsValidAbility(ability string) bool
- func SetVerificationCode(email *Email)
- func UniqueIDBeforeCreate(tx *gorm.DB, model interface{}, id *string) error
- type Campaign
- type Character
- type Email
- type Key
- type Level
- type Roll
- type Scale
- type Scroll
- type Society
- type Species
- type Stage
- type Table
- type TableRow
- type User
- type World
Constants ¶
View Source
const RollLogSeparator = "[ ~~~ ROLL LOG SEPARATOR ~~~]"
View Source
const RollResultSeparator = "[ ~~~ ROLL RESULT SEPARATOR ~~~]"
Variables ¶
This section is empty.
Functions ¶
func GenerateAPIKey ¶
func GenerateID ¶
func GenerateID() string
func GetAbility ¶
func GetFortitude ¶
func GetReflexes ¶
func IsValidAbility ¶
func SetVerificationCode ¶
func SetVerificationCode(email *Email)
Types ¶
type Campaign ¶
type Campaign struct { gorm.Model Slug string `json:"slug"` Name string `json:"name"` Description string `json:"description"` GMs []User `gorm:"many2many:campaign_gms;" json:"gms"` PCs []Character `gorm:"many2many:campaign_pcs;" json:"pcs"` Public bool `json:"public"` WorldID uint `json:"world_id"` World World `gorm:"foreignKey:WorldID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"world"` }
type Character ¶
type Character struct { ID string `gorm:"primaryKey" json:"id"` gorm.Model Name string `json:"name"` Description string `json:"description"` Str int `json:"strength"` Dex int `json:"dexterity"` Con int `json:"constitution"` Int int `json:"intelligence"` Wis int `json:"wisdom"` Cha int `json:"charisma"` Notes string `json:"notes"` PC bool `json:"pc"` Public bool `json:"public"` PlayerID uint `json:"player_id"` Player User `gorm:"foreignKey:PlayerID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"player"` }
type Roll ¶
type Roll struct { ID string `gorm:"primaryKey" json:"id"` gorm.Model Note *string `json:"note"` TableID uint `json:"table_id"` Table Table `gorm:"foreignKey:TableID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"table"` RollerID *uint `json:"roller_id,omitempty"` Roller *User `gorm:"foreignKey:RollerID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"roller,omitempty"` CharacterID *string `json:"character_id,omitempty"` Character *Character `gorm:"foreignKey:CharacterID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"character,omitempty"` Ability *string `json:"ability,omitempty"` CampaignID *uint `json:"campaign_id,omitempty"` Campaign *Campaign `gorm:"foreignKey:CampaignID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"campaign,omitempty"` Modifier int `json:"modifier"` Log string `json:"log"` Results string `json:"result"` }
type Scale ¶
type Scale struct { gorm.Model Name string `json:"name"` Slug string `json:"slug"` Description string `json:"description"` Public bool `json:"public"` Levels []Level `gorm:"foreignKey:ScaleID" json:"levels"` AuthorID uint `json:"author_id"` Author User `gorm:"foreignKey:AuthorID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"author"` }
type Scroll ¶
type Scroll struct { ID string `gorm:"primaryKey" json:"id"` gorm.Model Name string `json:"name"` Description string `json:"description"` Seals uint `json:"seals"` Writers []User `gorm:"many2many:scroll_writers;" json:"writers"` Readers []User `gorm:"many2many:scroll_readers;" json:"readers"` Public bool `json:"active" json:"public"` CampaignID *uint `json:"campaign_id"` Campaign *Campaign `gorm:"foreignKey:CampaignID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"campaign"` }
type Society ¶
type Society struct { gorm.Model Slug string `gorm:"unique" json:"slug"` Name string `json:"name"` Description string `json:"description"` Favored enums.AbilityPair `gorm:"type:string" json:"favored"` Languages string `json:"languages"` Public bool `json:"public"` WorldID uint `json:"world_id"` World World `gorm:"foreignKey:WorldID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"world"` }
type Species ¶
type Species struct { gorm.Model Slug string `gorm:"unique" json:"slug"` Name string `json:"name"` Description string `json:"description"` Affinities enums.AbilityPair `gorm:"type:string" json:"affinities"` Aversion enums.Ability `gorm:"type:string" json:"aversion"` Stages []Stage `gorm:"foreignKey:SpeciesID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"stages"` Public bool `json:"public"` WorldID uint `json:"world_id"` World World `gorm:"foreignKey:WorldID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"world"` }
type Table ¶
type Table struct { gorm.Model Name string `json:"name"` Slug string `json:"slug"` Description string `json:"description"` DiceLabel string `json:"dice_label"` Formula string `json:"formula"` Ability *string `json:"ability,omitempty"` Cumulative bool `json:"cumulative"` Rows []TableRow `gorm:"foreignKey:TableID" json:"rows"` Public bool `json:"public"` AuthorID uint `json:"author_id"` Author User `gorm:"foreignKey:AuthorID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:"author"` }
Click to show internal directories.
Click to hide internal directories.