models

package
v0.0.0-...-e8ce2a7 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Male   = Gender("male")
	Female = Gender("female")
	Other  = Gender("other")
)
View Source
const (
	HERO    = Gender("i")
	PARTNER = Gender("u")
	SUPPORT = Gender("support")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	gorm.Model
	UserID      uint
	Name        string
	Nickname    string
	Gender      string
	Outfit      string
	Hairstyle   string
	Personality string
	Tone        string
	Profile     string
}

type Event

type Event struct {
	gorm.Model
	Name string
}

type Gender

type Gender string

func ChoiceGender

func ChoiceGender(value string) (Gender, error)

type Plot

type Plot struct {
	gorm.Model
	UserID       uint
	Title        string
	Description  string
	Prompt       string
	Location     string
	Season       string
	Genre        string
	OutputFormat string
	ShowWarning  bool
	Supports     []Event `gorm:"many2many:supports;" json:"-"`
	Events       []Event `gorm:"many2many:plot_events;" json:"-"`
}

type PlotEvent

type PlotEvent struct {
	gorm.Model
	PlotID  uint
	EventID uint
}

type Role

type Role string

type Story

type Story struct {
	gorm.Model
	UserID     uint
	EventID    uint
	Prompt     string
	Text       string
	Characters []Character `gorm:"many2many:story_characters;" json:"-"`
}

type StoryCharacter

type StoryCharacter struct {
	gorm.Model
	StoryID     uint
	CharacterID uint
	Role        string
}

type Support

type Support struct {
	gorm.Model
	PlotID      uint
	CharacterID uint
}

type User

type User struct {
	gorm.Model
	Email       string `gorm:"unique;not null"`
	DisplayName string
}

func (*User) ToPlayer

func (m *User) ToPlayer() entities.Player

type UserToken

type UserToken struct {
	gorm.Model

	AccessToken  string    `gorm:"unique;not null" json:"access_token"`
	TokenType    string    `gorm:"not null" json:"token_type"`
	RefreshToken string    `gorm:"not null" json:"refresh_token"`
	Expiry       time.Time `gorm:"not null" json:"expiry"`
}

Jump to

Keyboard shortcuts

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