request

package
v0.0.0-...-064c0d0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSearchOrderField = "first_name"
	DefaultSearchDirection  = "asc"
)
View Source
const (
	GenderMale   = "male"
	GenderFemale = "female"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateCustomer

type CreateCustomer struct {
	FirstName string `form:"firstName" json:"firstName" valid:"printableascii,maxstringlength(100),required"`
	LastName  string `form:"lastName" json:"lastName" valid:"printableascii,maxstringlength(100),required"`
	BirthDate string `form:"birthDate" json:"birthDate" valid:"age(18|60),required"`
	Gender    string `form:"gender" json:"gender" valid:"gender,required"`
	Email     string `form:"email" json:"email" valid:"email,maxstringlength(255),required"`
	Address   string `form:"address" json:"address" valid:"printableascii,maxstringlength(200),optional"`
}

func (*CreateCustomer) BirthDateTime

func (c *CreateCustomer) BirthDateTime() (*time.Time, error)

func (*CreateCustomer) Validate

func (c *CreateCustomer) Validate() []string

type SearchCustomers

type SearchCustomers struct {
	Filter    *string `query:"s" json:"s" valid:"printableascii,maxstringlength(201),optional"`
	Order     *string `query:"o" json:"o" valid:"printableascii,in(first_name|last_name|birth_date|gender|email|address),optional"`
	Direction *string `query:"d" json:"d" valid:"printableascii,in(asc|desc),optional"`
	Page      *uint32 `query:"p" json:"p" valid:"numeric,inrange(1|99999),optional"`
}

func (*SearchCustomers) Normalized

func (*SearchCustomers) Validate

func (c *SearchCustomers) Validate() []string

type SearchCustomersNormalized

type SearchCustomersNormalized struct {
	Filter    string
	Order     string
	Direction string
	Page      uint32
}

Jump to

Keyboard shortcuts

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