validate

package
v0.0.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2016 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorProcessing

type ErrorProcessing struct {
	*service.Errors
	// contains filtered or unexported fields
}

func NewErrorProcessing

func NewErrorProcessing(pointer string) ErrorProcessing

func (*ErrorProcessing) AppendPointerError

func (e *ErrorProcessing) AppendPointerError(pointer string, title string, detail string)

func (*ErrorProcessing) Pointer

func (e *ErrorProcessing) Pointer() string

type FailureReasons

type FailureReasons map[string]ValidationInfo

type PlatformValidator

type PlatformValidator struct {
	FailureReasons
	// contains filtered or unexported fields
}

func NewPlatformValidator

func NewPlatformValidator() *PlatformValidator

func (*PlatformValidator) RegisterValidation

func (pv *PlatformValidator) RegisterValidation(tag ValidationTag, fn validator.Func)

func (*PlatformValidator) SetFailureReasons

func (pv *PlatformValidator) SetFailureReasons(reasons FailureReasons) *PlatformValidator

func (*PlatformValidator) Struct

func (pv *PlatformValidator) Struct(s interface{}, errorProcessing ErrorProcessing)

type ValidationInfo

type ValidationInfo struct {
	FieldName string
	Message   string
	Allowed   map[string]bool
}

type ValidationTag

type ValidationTag string

type Validator

type Validator interface {
	Struct(s interface{}, errorProcessing ErrorProcessing)
	RegisterValidation(tag ValidationTag, fn validator.Func)
}

Jump to

Keyboard shortcuts

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