Documentation
¶
Index ¶
- Variables
- type Campaign
- type Campaigns
- type Character
- type Characters
- type Level
- type Levels
- type Map
- type Maps
- type Quest
- type Quests
- type Revokedtoken
- type Revokedtokens
- type Tile
- type TileCategories
- type TileCategory
- type TileType
- type TileTypes
- type Tiles
- type User
- func (u *User) Create(tx *pop.Connection) (*validate.Errors, error)
- func (u User) String() string
- func (u *User) Validate(tx *pop.Connection) (*validate.Errors, error)
- func (u *User) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)
- func (u *User) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)
- type Users
Constants ¶
This section is empty.
Variables ¶
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) Validate ¶
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 ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Campaign) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required 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) Validate ¶
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 ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Character) ValidateUpdate ¶
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) Validate ¶
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 ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Level) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required 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) Validate ¶
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 ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Map) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required 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) Validate ¶
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 ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Quest) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required 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) Validate ¶
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 ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Tile) ValidateUpdate ¶
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) Validate ¶
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 ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*TileType) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required 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 ¶
Create wraps up the pattern of encrypting the password and running validations. Useful when writing tests.
func (*User) Validate ¶
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 ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*User) ValidateUpdate ¶
ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.