package
6.8.15+incompatible
Repository: https://github.com/agilebits/beats.git
Documentation: pkg.go.dev

# Functions

Compile takes the given map, validates the paths within it, and returns a Validator that can check real data.
Compose combines multiple SchemaValidators into a single one.
Is creates a named IsDef with the given checker.
IsAny takes a variable number of IsDef's and combines them with a logical OR.
IsArrayOf validates that the array at the given key is an array of objects all validatable via the given Validator.
IsDeepEqual checks equality using reflect.DeepEqual.
IsEqual tests that the given object is equal to the actual object.
IsEqualToTime ensures that the actual value is the given time, regardless of zone.
IsIntGt tests that a value is an int greater than.
IsStringContaining validates that the the actual value contains the specified substring.
KeyMissingResult is emitted when a key was expected, but was not present.
MustCompile compiles the given map, panic-ing if that map is invalid.
MustParsePath is a convenience method for parsing paths that have been previously validated.
MustRegisterEqual is the panic-ing equivalent of RegisterEqual.
NewResults creates a new Results object.
Optional wraps an IsDef to mark the field's presence as optional.
ParsePath parses a path of form key.[0].otherKey.[1] into a Path object.
RegisterEqual takes a function of the form fn(v someType) IsDef and registers it to check equality for that type.
SimpleResult provides a convenient and simple method for creating a *Results object for a single validation.
SingleResult returns a *Results object with a single validated value at the given path using the provided ValueResult as its sole validation.
Strict is used when you want any unspecified keys that are encountered to be considered errors.
StrictFailureResult is emitted when Strict() is used, and an unexpected field is found.
ValidResult is a convenience value for Valid results.

# Constants

PCMapKey is the Type for map keys.
PCSliceIdx is the Type for slice indices.

# Variables

IsDuration tests that the given value is a duration.
IsNil tests that a value is nil.
KeyMissing checks that the given key is not present defined.
KeyMissingVR is emitted when a key was expected, but was not present.
KeyPresent checks that the given key is in the map, even if it has a nil value.
StrictFailureVR is emitted when Strict() is used, and an unexpected field is found.
ValidVR is a convenience value for Valid results.

# Structs

InvalidEqualFnError is the error type returned by RegisterEqual when there is an issue with the given function.
An IsDef defines the type of check to do.
PathComponent structs represent one breadcrumb in a Path.
Results the results of executing a schema.
ValueResult represents the result of checking a leaf value.
ValueResultError is used to represent an error validating an individual value.

# Type aliases

CompiledSchema represents a compiled definition for driving a Validator.
InvalidPathString is the error type returned from unparseable paths.
Map is the type used to define schema definitions for Compile.
Path represents the path within a nested set of maps.
PathComponentType indicates the type of PathComponent.
Slice is a convenience []interface{} used to declare schema defs.
Validator is the result of Compile and is run against the map you'd like to test.
A ValueValidator is used to validate a value in a Map.