Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token struct { UUID uuid.UUID `json:"uuid" orm:"primaryKey;not null"` UserID int `json:"user_id" orm:"not null"` Privileges pq.StringArray `json:"privileges"` }
type User ¶
type User struct { ID int64 `json:"id" orm:"primaryKey;not null;autoIncrement"` Name string `json:"name" orm:"type:varchar(200);not null;uniqueIndex:username_index" validation:"required"` Age int64 `json:"age" orm:"not null;default:20;check:age > 20" validation:"required"` BirthDate datatypes.Date `json:"birth_date" orm:"not null" validation:"required"` Details datatypes.JSON `json:"details" orm:"type:jsonb"` Username string `json:"username" orm:"not null;uniqueIndex:username_index;check:age > 20" validation:"required"` Profile UserProfile `json:"profile" orm:"foreignKey:UserID->ID;onDelete:CASCADE; onUpdate:CASCADE"` Contact Contact `json:"contact" orm:"foreignKey:UserID->ID;onDelete:CASCADE; onUpdate:CASCADE"` Token Token `json:"tokens" orm:"foreignKey:UserID->ID;onDelete:CASCADE; onUpdate:CASCADE"` }
type UserProfile ¶
Click to show internal directories.
Click to hide internal directories.