Documentation ¶
Index ¶
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 Item ¶
type Item 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"` Title string `json:"title" db:"title"` Body nulls.String `json:"body" db:"body"` UserID uuid.UUID `json:"user_id" db:"user_id"` Completed bool `json:"completed" db:"completed"` }
func (*Item) 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 (*Item) ValidateCreate ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.
func (*Item) 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:"-" db:"-"` PasswordConfirmation string `json:"-" db:"-"` }
func (*User) Create ¶
Create wraps up the pattern of encrypting the password and running validations. Useful when writing tests.
func (*User) ValidateCreate ¶
ValidateCreate gets run every time you call "pop.ValidateAndCreate" method.