models

package
v0.0.0-...-44d1ee4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type User

type User struct {
	ID              uuid.UUID `json:"id" db:"id"`
	Username        string    `json:"username" db:"username"`
	Email           string    `json:"email" db:"email"`
	Admin           bool      `json:"admin" db:"admin"`
	CreatedAt       time.Time `json:"created_at" db:"created_at"`
	UpdatedAt       time.Time `json:"updated_at" db:"updated_at"`
	PasswordHash    string    `json:"-" db:"password_hash"`
	Password        string    `json:"-" db:"-"`
	PasswordConfirm string    `json:"-" db:"-"`
}

User is used by pop to map your users database table to your go code.

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