Documentation
¶
Index ¶
- Constants
- Variables
- func ValidTokenText(v *validator.Validator, text string)
- func ValidateEmail(v *validator.Validator, email string)
- func ValidateFilters(v *validator.Validator, f Filters)
- func ValidateMovie(v *validator.Validator, movie *Movie)
- func ValidatePasswordText(v *validator.Validator, password string)
- func ValidateUser(v *validator.Validator, user *User)
- type Filters
- type MetaData
- type Model
- type Movie
- type MovieModel
- type Password
- type PermissionModel
- type Permissions
- type Runtime
- type Token
- type TokenModel
- type User
- type UserModel
Constants ¶
View Source
const ( ScopeActivation = "activation" ScopeAuthentication = "authentication" ScopePasswordReset = "password-reset" )
Variables ¶
View Source
var ( ErrRecordNotFound = errors.New("record not found") ErrEditConflict = errors.New("edit conflict") )
View Source
var ( ErrDuplicateEmail = errors.New("duplicate email") Anonymous = &User{} )
View Source
var ErrInvalidRuntimeFormat = errors.New("invalid runtime format")
Functions ¶
func ValidTokenText ¶
func ValidateEmail ¶
func ValidateFilters ¶
func ValidateMovie ¶
func ValidatePasswordText ¶
func ValidateUser ¶
Types ¶
type Model ¶
type Model struct { Movie MovieModel User UserModel Token TokenModel Permission PermissionModel }
type MovieModel ¶
func (MovieModel) Delete ¶
func (m MovieModel) Delete(id int64) error
func (MovieModel) Insert ¶
func (m MovieModel) Insert(movie *Movie) error
func (MovieModel) SelectMany ¶
func (MovieModel) Update ¶
func (m MovieModel) Update(movie *Movie) error
type PermissionModel ¶
func (PermissionModel) GetUserPermissions ¶
func (p PermissionModel) GetUserPermissions(userID int64) (Permissions, error)
type Permissions ¶
type Permissions []string
func (Permissions) Contains ¶
func (p Permissions) Contains(code string) bool
type TokenModel ¶
func (TokenModel) DeleteAllForUser ¶
func (t TokenModel) DeleteAllForUser(scope string, userID int64) error
func (TokenModel) Insert ¶
func (t TokenModel) Insert(token *Token) error
type User ¶
type User struct { ID int64 `json:"id"` Name string `json:"name"` Email string `json:"email"` Password Password `json:"-"` Activated bool `json:"activated"` Version int32 `json:"-"` CreatedAt time.Time `json:"created_at"` }
func (*User) IsAnonymous ¶
Click to show internal directories.
Click to hide internal directories.