simple

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dog

type Dog struct {
	Name string `validate:"min_len=1,max_len=64" json:"name"`
}

func (Dog) Validate

func (r Dog) Validate() error

Validate validates Dog

type Title

type Title string
const (
	None   Title = ""
	Doctor Title = "Dr"
	Sir    Title = "Sir"
	Father Title = "Father"
)

func (Title) Validate

func (r Title) Validate() error

Validate validates Title

type User

type User struct {
	Name   string         `json:"name" validate:"min_len=3,max_len=64"`
	Age    uint           `json:"age" validate:"min=18,max=95"`
	Dog    Dog            `json:"dog_pet"`
	Emails map[int]string `validate:"min_items=1,key=[max=3],value=[min_len=5]"`
	Title  *Title         `validate:"not_null"`
}

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