Documentation ¶
Index ¶
- Constants
- type Array
- type ArrayCSV
- type ArrayJson
- type ArrayKV
- type CSV
- type ConfigAPI
- type ConfigAuth
- type ConfigDB
- type ConfigEmail
- type Email
- type Json
- type KV
- type Login
- type Model
- type Notification
- type NotificationDTO
- type Object
- type PasswordReset
- type SMS
- type User
- type UserDTO
- type ValidationError
- type Yaml
Constants ¶
View Source
const ( DefaultDBMySQL = "false" EnvPort = "PORT" )
View Source
const ( RoleAdmin = "admin" RoleClient = "client" RoleModerator = "moderator" RoleService = "service" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigAPI ¶
type ConfigAPI struct { ConfigAuth ConfigDB ConfigEmail Port uint16 }
type ConfigAuth ¶
type ConfigEmail ¶
type Notification ¶
type NotificationDTO ¶
type PasswordReset ¶
type User ¶
type User struct { Model Address string `json:"address,omitempty" validate:"max=128"` AuthID string `json:"authID,omitempty"` AuthProvider string `json:"authProvider,omitempty"` Dob time.Time `json:"dob,omitempty"` // todo: date validation FirstName string `json:"firstName" validate:"min=1,max=64"` LastName string `json:"lastName" validate:"min=2,max=64"` Email string `json:"email,omitempty" gorm:"uniqueIndex,size:255" validate:"email,max=64"` // todo: required if no mobile History []Login `json:"history,omitempty" gorm:"foreignKey:CreatedByID"` LastSeenAt time.Time `json:"lastSeenAt,omitempty"` Mobile string `json:"mobile" gorm:"unique" validate:"numeric"` // todo: required if no email Notifications []Notification `json:"notifications,omitempty"` Password string `json:"password,omitempty"` Photo string `json:"photo,omitempty"` Recovery string `json:"recovery,omitempty"` // todo validate:"numeric,len=6" Scopes string `json:"scopes"` }
type UserDTO ¶
type UserDTO struct { ID uint `json:"id"` Address string `json:"address,omitempty"` AuthID string `json:"authID,omitempty"` AuthProvider string `json:"authProvider,omitempty"` CreatedAt time.Time `json:"createdAt"` Dob time.Time `json:"dob,omitempty"` Email string `json:"email,omitempty"` FirstName string `json:"firstName"` LastName string `json:"lastName"` LastSeenAt time.Time `json:"lastSeenAt"` Mobile string `json:"mobile"` Photo string `json:"photo,omitempty"` Scopes string `json:"scopes"` }
type ValidationError ¶
func GetValidationErrors ¶
func GetValidationErrors(srcErr error) []*ValidationError
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.