validator

package
v0.47.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 1 Imported by: 11 modules, 9 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

This section is empty.

Functions

This section is empty.

Types

type Validator

type Validator interface {
	// Validate takes a list of arbitrary objects and returns a slice of results,
	// one for each object validated.
	Validate(...interface{}) []errors.ManifestResult
	// WithValidators returns a Validator appended to a variable number of
	// Validator's.
	WithValidators(...Validator) Validators
}

Validator is an interface for validating arbitrary objects.

type ValidatorFunc

type ValidatorFunc func(...interface{}) []errors.ManifestResult

ValidatorFunc implements Validator. ValidatorFunc can be used as a wrapper for functions that run object validators.

func (ValidatorFunc) Validate

func (f ValidatorFunc) Validate(objs ...interface{}) (results []errors.ManifestResult)

Validate runs the ValidatorFunc on objs.

func (ValidatorFunc) WithValidators

func (f ValidatorFunc) WithValidators(vals ...Validator) Validators

WithValidators appends the ValidatorFunc to vals.

type Validators

type Validators []Validator

Validators is a set of Validator's that implements Validate.

func (Validators) Validate

func (validators Validators) Validate(objs ...interface{}) (results []errors.ManifestResult)

Validate invokes each Validator in Validators, collecting and returning the results.

func (Validators) WithValidators

func (validators Validators) WithValidators(vals ...Validator) Validators

WithValidators appends vals to Validators.

Jump to

Keyboard shortcuts

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