Documentation ¶
Overview ¶
The `models` module provides core database types like User.
These structures should stay pretty much the same, so if you need additional fields, just extend the struct and build the object with joins.
Please don't alter tables; add a relationship with an ORM to another table, or use an adjacent table with joins: “select * from users join cldata.users on public.users.id = cldata.users.uid where id = $(uuidgen);“
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAuthTokenInvalid = errors.New("auth token issued or read from database incorrectly") ErrAuthTokenExpired = errors.New("auth token expired or revoked") )
Unstable; these errors will probably move elsewhere.
Functions ¶
This section is empty.
Types ¶
type AuthToken ¶
type User ¶
type User struct { bun.BaseModel `bun:"table:users"` ID string `json:"id" bun:",pk,type:uuid"` Username string `json:"username"` GivenName string `json:"given_name"` FamilyName string `json:"family_name"` MiddleName string `json:"middle_name,omitempty"` NameSuffix string `json:"name_suffix,omitempty"` Email string `json:"email,omitempty"` LastLogin time.Time `json:"last_login"` // omitempty doesn't work for literal null CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Click to show internal directories.
Click to hide internal directories.