aliases

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FloatType

type FloatType float64

func (FloatType) Validate

func (r FloatType) Validate() error

Validate validates FloatType

type IntType

type IntType int

func (IntType) Validate

func (r IntType) Validate() error

Validate validates IntType

type MapType

type MapType map[string]int

func (MapType) Validate

func (r MapType) Validate() error

Validate validates MapType

type StringType

type StringType string

StringType validator will be overridden by validation tags in-place

func (StringType) Validate

func (t StringType) Validate() error

func (StringType) ValidateNotEmpty

func (t StringType) ValidateNotEmpty() error

type User

type User struct {
	FirstName           StringType  `validate:"min_len=2,max_len=15"`
	LastName            string      `validate:"min_len=1,max_len=15"`
	NonEmptyString      StringType  `validate:"func=.ValidateNotEmpty"`
	FamilyMembers       IntType     `validate:"min=1,max=100"`
	SomeFloat           FloatType   `validate:"min=2.55,max=99.99"`
	SomeMap             MapType     `validate:"min_items=2,key=[max_len=64],value=[min=-35,max=34]"`
	SomePointer         *StringType `validate:"not_null,min_len=20,max_len=150"`
	SomePointerNullable *StringType `validate:"nullable"`
}

func (User) Validate

func (r User) Validate() error

Validate validates User

Jump to

Keyboard shortcuts

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