server

package
Version: v0.0.0-...-0bfac37 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidationErrors

func ValidationErrors(e error) []map[string]string

ValidationErrors formats errors to be appropriate for a JSON response body

Types

type Limit

type Limit struct {
	// The offset
	//
	// required: true
	Offset *int `form:"offset" validate:"required,numeric"`
	// The limit
	//
	// required: true
	Limit *int `form:"limit" validate:"required,numeric"`
	// The country code of the user
	CountryCode string `form:"country" validate:"omitempty,len=2"`
}

Limit is a struct for the query params required for the List endpoint swagger:model

type User

type User struct {
	// The id for the user
	//
	// required: true
	// min: 1
	ID uint `gorm:"primary_key;column:Id"`
	// The first name for the user
	//
	// required: true
	// min: 1
	// max: 50
	FirstName string `json:"firstName" validate:"required,max=50" gorm:"column:FirstName"`
	// The last name for the user
	//
	// required: true
	// min: 1
	// max: 50
	LastName string `json:"lastName" validate:"required,max=50" gorm:"column:LastName"`
	// The nickname for the user
	//
	// required: true
	// min: 1
	// max: 100
	Nickname string `json:"nickname" validate:"required,max=100" gorm:"column:Nickname"`
	// The email address of the user
	//
	// required: true
	// example: user@faceit.com
	Email string `json:"email" validate:"required,email" gorm:"column:Email"`
	// The country code of the user
	//
	// required: true
	// min:2
	// max:2
	// example: GB
	CountryCode string `json:"countryCode" validate:"required,len=2" gorm:"column:CountryCode"`
	// The created at time
	CreatedAt *time.Time `gorm:"column:CreatedAt"`
	// The updated at time
	UpdatedAt *time.Time `gorm:"column:UpdatedAt"`
	// The deleted at time
	DeletedAt *time.Time `gorm:"column:DeletedAt"`
}

User the user model with struct tags for JSON decoding, validation rules and GORM column names swagger:model

func (User) TableName

func (User) TableName() string

TableName overwrites the default table name

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL