gkexample

package
v0.0.0-...-094b17c Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Code in this file generated by gokay: github.com/zencoder/gokay

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCustomGenerator

func NewCustomGenerator() *gkgen.ValidateGenerator

To run: `gokay gkexample NewCustomGenerator`

Types

type AlwaysValid

type AlwaysValid struct{}

AlwaysValid

func (AlwaysValid) Validate

func (s AlwaysValid) Validate() error

Validate

type Example

type Example struct {
	MapOfInterfaces map[string]interface{} `valid:"NotNil"`
}

Example

func (Example) Validate

func (s Example) Validate() error

type ExampleStruct

type ExampleStruct struct {
	HexStringPtr            *string `valid:"Length=(16),NotNil,Hex"`
	HexString               string  `valid:"Length=(12),Hex"`
	BCP47StringPtr          *string `valid:"NotNil,BCP47"`
	BCP47String             string  `valid:"BCP47"`
	CanBeNilWithConstraints *string `valid:"Length=(12)"`
	BCP47NonString          int
	BCP47NonStringPtr       *int
}

ExampleStruct def with tags

func (ExampleStruct) Validate

func (s ExampleStruct) Validate() error

type HasValidateImplicit

type HasValidateImplicit struct {
	InvalidStruct *TestValidate
	ValidStruct   AlwaysValid

	MapOfStruct     map[string]TestValidate
	MapOfStructPtrs map[string]*TestValidate
	MapOfMaps       map[string]map[string]*TestValidate
	MapMapsOfSlices map[string]map[string][]*TestValidate
	MapOfInterfaces map[string]interface{}

	SimpleSlice           []*TestValidate
	SliceOfSlicesOfSlices [][][]*TestValidate

	MapOfSlicesOfMaps map[string][]map[string]*TestValidate
}

func (HasValidateImplicit) Validate

func (s HasValidateImplicit) Validate() error

Validate

type NoImplicitValidate

type NoImplicitValidate struct {
	StringField string

	NonStringKeyMap             map[int]TestValidate
	NestedNonStringKeyMap       map[string]map[int]map[string]*TestValidate
	NestedMapWithNonStructValue map[string]map[string]map[string]*int64

	SliceOfBuiltins       []string
	NestedSliceofBuiltins [][][]*int
}

type NotNilTestStruct

type NotNilTestStruct struct {
	NotNilMap       map[string]interface{} `valid:"NotNil"`
	NotNilSlice     []string               `valid:"NotNil"`
	NotNilInterface interface{}
}

func (NotNilTestStruct) Validate

func (s NotNilTestStruct) Validate() error

Validate

type TestValidate

type TestValidate struct {
	Valid bool
}

TestValidate

func (TestValidate) Validate

func (s TestValidate) Validate() error

Validate

Jump to

Keyboard shortcuts

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