model

package
v0.0.0-...-4955f5c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pagination

type Pagination struct {
	Page  int    `validate:"gt=0,lte=10000"`
	Limit int    `validate:"gt=0,lte=10000"`
	Sort  string `validate:"oneof=asc desc"`
}

Pagination to represents common parameters for endpoint that implement pagination

func NewPagination

func NewPagination() *Pagination

NewPagination returns new Pagination struct with default values

type User

type User struct {
	ID          string    `json:"id"`
	Username    string    `json:"username"`
	Firstname   string    `json:"first_name" db:"first_name"`
	Lastname    string    `json:"last_name" db:"last_name"`
	Email       string    `json:"email"`
	Password    []byte    `json:"-"`
	DateJoined  time.Time `json:"date_joined" db:"date_joined"`
	LastLogin   time.Time `json:"last_login" db:"last_login"`
	IsActive    bool      `json:"is_active" db:"is_active"`
	IsStaff     bool      `json:"is_staff" db:"is_staff"`
	IsSuperuser bool      `json:"is_superuser" db:"is_superuser"`
}

User represents someone with access to our system.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL