validation

package
v0.0.0-...-c113622 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Builtins = NewTestContext(nil)
View Source
var DefaultComparators = NewComparators()

Functions

func IsNotExpectedError

func IsNotExpectedError(err error) bool

func NewNotExpectedError

func NewNotExpectedError() error

Types

type Comparators

type Comparators struct {
	// contains filtered or unexported fields
}

Comparators is a collection of compare functions

func NewComparators

func NewComparators() Comparators

NewComparators will return Comparators

func (*Comparators) Get

func (c *Comparators) Get(name string) CompareFunc

Get will return a comparator function by name

type CompareFunc

type CompareFunc func(value interface{}, expected interface{}) error

CompareFunc is the function definition of test comparator without type-system

type NotExpectedError

type NotExpectedError struct {
	// contains filtered or unexported fields
}

func (*NotExpectedError) Error

func (e *NotExpectedError) Error() string

type TestComparator

type TestComparator struct {
	Comparators *Comparators
}

func NewTestContext

func NewTestContext(m map[string]CompareFunc) TestComparator

func (*TestComparator) NewValidator

func (ctx *TestComparator) NewValidator(valuePath string, expected interface{}, comparator string) driver.TestValidator

NewValidator will return new validator to validate value is expected

Jump to

Keyboard shortcuts

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