check

package
v0.0.0-...-800adf3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: ISC Imports: 8 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	Pointer djson.Pointer
	Errors  ValidationErrors
}

func NewChecker

func NewChecker() *Checker

func (*Checker) AddError

func (c *Checker) AddError(token interface{}, code, format string, args ...interface{})

func (*Checker) Check

func (c *Checker) Check(token interface{}, v bool, code, format string, args ...interface{}) bool

func (*Checker) CheckArrayLengthMax

func (c *Checker) CheckArrayLengthMax(token interface{}, value interface{}, max int) bool

func (*Checker) CheckArrayLengthMin

func (c *Checker) CheckArrayLengthMin(token interface{}, value interface{}, min int) bool

func (*Checker) CheckArrayLengthMinMax

func (c *Checker) CheckArrayLengthMinMax(token interface{}, value interface{}, min, max int) bool

func (*Checker) CheckArrayNotEmpty

func (c *Checker) CheckArrayNotEmpty(token interface{}, value interface{}) bool

func (*Checker) CheckFloatMax

func (c *Checker) CheckFloatMax(token interface{}, i, max float64) bool

func (*Checker) CheckFloatMin

func (c *Checker) CheckFloatMin(token interface{}, i, min float64) bool

func (*Checker) CheckFloatMinMax

func (c *Checker) CheckFloatMinMax(token interface{}, i, min, max float64) bool

func (*Checker) CheckIntMax

func (c *Checker) CheckIntMax(token interface{}, i, max int) bool

func (*Checker) CheckIntMin

func (c *Checker) CheckIntMin(token interface{}, i, min int) bool

func (*Checker) CheckIntMinMax

func (c *Checker) CheckIntMinMax(token interface{}, i, min, max int) bool

func (*Checker) CheckObject

func (c *Checker) CheckObject(token interface{}, value interface{}) bool

func (*Checker) CheckObjectArray

func (c *Checker) CheckObjectArray(token interface{}, value interface{}) bool

func (*Checker) CheckObjectMap

func (c *Checker) CheckObjectMap(token interface{}, value interface{}) bool

func (*Checker) CheckOptionalObject

func (c *Checker) CheckOptionalObject(token interface{}, value interface{}) bool

func (*Checker) CheckStringHTTPURI

func (c *Checker) CheckStringHTTPURI(token interface{}, s string) bool

func (*Checker) CheckStringLengthMax

func (c *Checker) CheckStringLengthMax(token interface{}, s string, max int) bool

func (*Checker) CheckStringLengthMin

func (c *Checker) CheckStringLengthMin(token interface{}, s string, min int) bool

func (*Checker) CheckStringLengthMinMax

func (c *Checker) CheckStringLengthMinMax(token interface{}, s string, min, max int) bool

func (*Checker) CheckStringMatch

func (c *Checker) CheckStringMatch(token interface{}, s string, re *regexp.Regexp) bool

func (*Checker) CheckStringMatch2

func (c *Checker) CheckStringMatch2(token interface{}, s string, re *regexp.Regexp, code, format string, args ...interface{}) bool

func (*Checker) CheckStringNotEmpty

func (c *Checker) CheckStringNotEmpty(token interface{}, s string) bool

func (*Checker) CheckStringURI

func (c *Checker) CheckStringURI(token interface{}, s string) bool

func (*Checker) CheckStringValue

func (c *Checker) CheckStringValue(token interface{}, value interface{}, values interface{}) bool

func (*Checker) Error

func (c *Checker) Error() error

func (*Checker) Pop

func (c *Checker) Pop()

func (*Checker) Push

func (c *Checker) Push(token interface{})

func (*Checker) WithChild

func (c *Checker) WithChild(token interface{}, fn func())

type Object

type Object interface {
	Check(*Checker)
}

type ValidationError

type ValidationError struct {
	Pointer djson.Pointer `json:"pointer"`
	Code    string        `json:"code"`
	Message string        `json:"message"`
}

func (ValidationError) Error

func (err ValidationError) Error() string

func (ValidationError) GoString

func (err ValidationError) GoString() string

func (ValidationError) String

func (err ValidationError) String() string

type ValidationErrors

type ValidationErrors []*ValidationError

func (ValidationErrors) Error

func (errs ValidationErrors) Error() string

Jump to

Keyboard shortcuts

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