models

package
v0.0.0-...-e0d4dcd Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *pop.Connection

DB is a connection to your database to be used throughout your application.

Functions

This section is empty.

Types

type Campaign

type Campaign struct {
	ID          uuid.UUID  `json:"id" db:"id"`
	UserID      uuid.UUID  `json:"-" db:"user_id"`
	Name        string     `json:"name" db:"name"`
	Description string     `json:"description" db:"description"`
	Characters  Characters `json:"characters,omitempty" has_many:"characters" order_by:"created_at asc"`
	Quests      Quests     `json:"quests,omitempty" has_many:"quests" order_by:"sort_order asc"`
	CreatedAt   time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time  `json:"updated_at" db:"updated_at"`
}

Campaign is used by pop to map your .model.Name.Proper.Pluralize.Underscore database table to your go code.

func (Campaign) String

func (c Campaign) String() string

String is not required by pop and may be deleted

func (*Campaign) Validate

func (c *Campaign) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Campaign) ValidateCreate

func (c *Campaign) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Campaign) ValidateUpdate

func (c *Campaign) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Campaigns

type Campaigns []Campaign

Campaigns is not required by pop and may be deleted

func (Campaigns) String

func (c Campaigns) String() string

String is not required by pop and may be deleted

type Character

type Character struct {
	ID          uuid.UUID  `json:"id" db:"id"`
	UserID      uuid.UUID  `json:"-" db:"user_id"`
	User        *User      `json:"-" belongs_to:"user"`
	Name        string     `json:"name" db:"name"`
	Description string     `json:"description" db:"description"`
	CampaignID  nulls.UUID `json:"-" db:"campaign_id"`
	Campaign    *Campaign  `json:"campaign,omitempty" belongs_to:"campaign"`
	CreatedAt   time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time  `json:"updated_at" db:"updated_at"`
}

Character is used by pop to map your .model.Name.Proper.Pluralize.Underscore database table to your go code.

func (Character) String

func (c Character) String() string

String is not required by pop and may be deleted

func (*Character) Validate

func (c *Character) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Character) ValidateCreate

func (c *Character) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Character) ValidateUpdate

func (c *Character) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Characters

type Characters []Character

Characters is not required by pop and may be deleted

func (Characters) String

func (c Characters) String() string

String is not required by pop and may be deleted

type Level

type Level struct {
	ID          uuid.UUID `json:"id" db:"id"`
	UserID      uuid.UUID `json:"-" db:"user_id"`
	Name        string    `json:"name" db:"name"`
	Description string    `json:"description" db:"description"`
	MapID       uuid.UUID `json:"map_id" db:"map_id"`
	Map         *Map      `json:"map,omitempty" belongs_to:"map"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time `json:"updated_at" db:"updated_at"`
	SortOrder   int       `json:"sort_order" db:"sort_order"`
}

Level is used by pop to map your .model.Name.Proper.Pluralize.Underscore database table to your go code.

func (Level) String

func (l Level) String() string

String is not required by pop and may be deleted

func (*Level) Validate

func (l *Level) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Level) ValidateCreate

func (l *Level) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Level) ValidateUpdate

func (l *Level) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Levels

type Levels []Level

Levels is not required by pop and may be deleted

func (Levels) String

func (l Levels) String() string

String is not required by pop and may be deleted

type Map

type Map struct {
	ID          uuid.UUID `json:"id" db:"id"`
	UserID      uuid.UUID `json:"-" db:"user_id"`
	Name        string    `json:"name" db:"name"`
	Description string    `json:"description" db:"description"`
	QuestID     uuid.UUID `json:"quest_id" db:"quest_id"`
	Quest       *Quest    `json:"quest,omitempty" belongs_to:"quest"`
	Levels      Levels    `json:"levels,omitempty" has_many:"levels" order_by:"sort_order asc"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time `json:"updated_at" db:"updated_at"`
	SortOrder   int       `json:"sort_order" db:"sort_order"`
}

Map is used by pop to map your .model.Name.Proper.Pluralize.Underscore database table to your go code.

func (Map) String

func (m Map) String() string

String is not required by pop and may be deleted

func (*Map) Validate

func (m *Map) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Map) ValidateCreate

func (m *Map) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Map) ValidateUpdate

func (m *Map) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Maps

type Maps []Map

Maps is not required by pop and may be deleted

func (Maps) String

func (m Maps) String() string

String is not required by pop and may be deleted

type Quest

type Quest struct {
	ID          uuid.UUID `json:"id" db:"id"`
	UserID      uuid.UUID `json:"-" db:"user_id"`
	Name        string    `json:"name" db:"name"`
	Description string    `json:"description" db:"description"`
	CampaignID  uuid.UUID `json:"campaign_id" db:"campaign_id"`
	Campaign    *Campaign `json:"campaign,omitempty" belongs_to:"campaign"`
	Maps        Maps      `json:"maps,omitempty" has_many:"maps" order_by:"sort_order asc"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
	UpdatedAt   time.Time `json:"updated_at" db:"updated_at"`
	SortOrder   int       `json:"sort_order" db:"sort_order"`
}

Quest is used by pop to map your .model.Name.Proper.Pluralize.Underscore database table to your go code.

func (Quest) String

func (q Quest) String() string

String is not required by pop and may be deleted

func (*Quest) Validate

func (q *Quest) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Quest) ValidateCreate

func (q *Quest) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Quest) ValidateUpdate

func (q *Quest) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Quests

type Quests []Quest

Quests is not required by pop and may be deleted

func (Quests) String

func (q Quests) String() string

String is not required by pop and may be deleted

type Revokedtoken

type Revokedtoken struct {
	ID        uuid.UUID `json:"id" db:"id"`
	Token     string    `json:"token" db:"token"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}

Revokedtoken is used by pop to map your .model.Name.Proper.Pluralize.Underscore database table to your go code.

func (Revokedtoken) String

func (r Revokedtoken) String() string

String is not required by pop and may be deleted

func (*Revokedtoken) Validate

func (r *Revokedtoken) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Revokedtoken) ValidateCreate

func (r *Revokedtoken) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Revokedtoken) ValidateUpdate

func (r *Revokedtoken) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Revokedtokens

type Revokedtokens []Revokedtoken

Revokedtokens is not required by pop and may be deleted

func (Revokedtokens) String

func (r Revokedtokens) String() string

String is not required by pop and may be deleted

type Tile

type Tile struct {
	ID         uuid.UUID `json:"id" db:"id"`
	UserID     uuid.UUID `json:"-" db:"user_id"`
	LevelID    uuid.UUID `json:"level_id" db:"level_id"`
	Level      *Level    `json:"level,omitempty" belongs_to:"level"`
	X          int       `json:"x" db:"x"`
	Y          int       `json:"y" db:"y"`
	TileTypeID uuid.UUID `json:"-" db:"tile_type_id"`
	TileType   *TileType `json:"tile_type" belongs_to:"tile_type"`
	CreatedAt  time.Time `json:"created_at" db:"created_at"`
	UpdatedAt  time.Time `json:"updated_at" db:"updated_at"`
}

Tile is used by pop to map your .model.Name.Proper.Pluralize.Underscore database table to your go code.

func (Tile) String

func (t Tile) String() string

String is not required by pop and may be deleted

func (*Tile) Validate

func (t *Tile) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Tile) ValidateCreate

func (t *Tile) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Tile) ValidateUpdate

func (t *Tile) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type TileCategories

type TileCategories []TileCategory

Tiles is not required by pop and may be deleted

func (TileCategories) String

func (t TileCategories) String() string

String is not required by pop and may be deleted

type TileCategory

type TileCategory struct {
	ID        uuid.UUID `json:"id" db:"id"`
	Name      string    `json:"name" db:"name"`
	TileTypes TileTypes `json:"tile_types,omitempty" has_many:"tile_types"`
	CreatedAt time.Time `json:"created_at" db:"created_at"`
	UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}

Tile is used by pop to map your .model.Name.Proper.Pluralize.Underscore database table to your go code.

func (TileCategory) String

func (t TileCategory) String() string

String is not required by pop and may be deleted

func (*TileCategory) Validate

func (t *TileCategory) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*TileCategory) ValidateCreate

func (t *TileCategory) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*TileCategory) ValidateUpdate

func (t *TileCategory) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type TileType

type TileType struct {
	ID             uuid.UUID     `json:"id" db:"id"`
	Name           string        `json:"name" db:"name"`
	TileCategoryID uuid.UUID     `json:"-" db:"tile_category_id"`
	TileCategory   *TileCategory `json:"tile_category" belongs_to:"tile_category"`
	Tiles          Tiles         `json:"tiles,omitempty" has_many:"tiles"`
	CreatedAt      time.Time     `json:"created_at" db:"created_at"`
	UpdatedAt      time.Time     `json:"updated_at" db:"updated_at"`
}

Tile is used by pop to map your .model.Name.Proper.Pluralize.Underscore database table to your go code.

func (TileType) String

func (t TileType) String() string

String is not required by pop and may be deleted

func (*TileType) Validate

func (t *TileType) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*TileType) ValidateCreate

func (t *TileType) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*TileType) ValidateUpdate

func (t *TileType) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type TileTypes

type TileTypes []TileType

Tiles is not required by pop and may be deleted

func (TileTypes) String

func (t TileTypes) String() string

String is not required by pop and may be deleted

type Tiles

type Tiles []Tile

Tiles is not required by pop and may be deleted

func (Tiles) String

func (t Tiles) String() string

String is not required by pop and may be deleted

type User

type User struct {
	ID                   uuid.UUID  `json:"id" db:"id"`
	CreatedAt            time.Time  `json:"created_at" db:"created_at"`
	UpdatedAt            time.Time  `json:"updated_at" db:"updated_at"`
	Email                string     `json:"email" db:"email"`
	PasswordHash         string     `json:"-" db:"password_hash"`
	Password             string     `json:"password" db:"-"`
	PasswordConfirmation string     `json:"password_confirmation" db:"-"`
	Characters           Characters `json:"characters,omitempty" has_many:"characters" order_by:"created_at asc"`
	Campaigns            Campaigns  `json:"campaigns,omitempty" has_many:"campaigns" order_by:"created_at asc"`
}

User is a generated model from buffalo-auth, it serves as the base for username/password authentication.

func (*User) Create

func (u *User) Create(tx *pop.Connection) (*validate.Errors, error)

Create wraps up the pattern of encrypting the password and running validations. Useful when writing tests.

func (User) String

func (u User) String() string

String is not required by pop and may be deleted

func (*User) Validate

func (u *User) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*User) ValidateCreate

func (u *User) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*User) ValidateUpdate

func (u *User) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Users

type Users []User

Users is not required by pop and may be deleted

func (Users) String

func (u Users) String() string

String is not required by pop and may be deleted

Jump to

Keyboard shortcuts

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