validation

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: GPL-3.0 Imports: 5 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFields added in v1.6.0

func GetFields(t Dataer) map[string]interface{}

GetFields returns

func GetMeta

func GetMeta(tag string, kind reflect.Kind) tagMeta

GetMeta returns the `hsk` meta tags associated with a field.

func Struct added in v1.7.0

func Struct(obj interface{}) error

ValidateStruct will read 'hsk' tags on properties, to validate their values Properties without the 'hsk' tag, will be considered 'Required'

Types

type Dataer added in v1.6.0

type Dataer interface {
	Valid() error
}

Dataer is the primary interface that any "model" should implement "Models" are data objects used to store and structure records in tables.

type IValidation

type IValidation interface {
	Valid(obj interface{}, meta tagMeta) (bool, []string)
}

IValidation provides a Validation method for checking `hsk` tags

func GetTypeValidator

func GetTypeValidator(fieldType reflect.Kind) IValidation

GetTypeValidator returns a Validation Function for a Specific Type

Jump to

Keyboard shortcuts

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