validation

package
v0.22.74 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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