Categorygithub.com/go-json-schema/validator
modulepackage
0.0.0-20180109105346-c152aa67b98c
Repository: https://github.com/go-json-schema/validator.git
Documentation: pkg.go.dev

# README

validator

Generate a validator from github.com/go-json-schema/schema definitions

(previously known as github.com/lestrrat/go-jsval)

# Packages

No description provided by the author

# Functions

All creates a new AllConstraint.
Any creates a new AnyConstraint.
Array creates a new ArrayConstraint.
Boolean creates a new BooleanConsraint.
Enum creates a new EnumConstraint.
Integer creates a new IntegerrConstraint.
New creates a new JSVal instance.
NewGenerator creates a new Generator.
Not creates a new NotConstraint.
Number creates a new NumberConstraint.
Object creates a new ObjectConstraint.
OneOf creates a new OneOfConstraint.
Reference creates a new ReferenceConstraint object.
String creates a new StringConstraint.

# Variables

EmptyConstraint is a constraint that returns true for any value.
NullConstraint is a constraint that only matches the JSON "null" value, or "nil" in golang.

# Structs

AllConstraint implements a constraint where all of the child constraints' validation must pass in order for this validation to pass.
AnyConstraint implements a constraint where at least 1 child constraint must pass in order for this validation to pass.
ArrayConstraint implements a constraint to match against various aspects of a Array/Slice structure.
BooleanConstraint implements a constraint to match against a boolean.
ConstraintMap is an implementation of RefResolver.
EnumConstraint implements a constraint where the incoming value must match one of the values enumerated in the constraint.
No description provided by the author
Generator is responsible for generating Go code that sets up a validator.
IntegerConstraint implements a constraint to match against an integer type.
JSVal is the main validator object.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NotConstraint implements a constraint where the result of child constraint is negated -- that is, validation passes only if the child constraint fails.
NumberConstraint implements a constraint to match against a number (i.e.
ObjectConstraint implements a constraint to match against various aspects of a Map-like structure.
OneOfConstraint implements a constraint where only exactly one of the child constraints' validation can pass.
No description provided by the author
ReferenceConstraint is a constraint where its actual definition is stored elsewhere.
StringConstraint implements a constraint to match against a string.
No description provided by the author
No description provided by the author

# Interfaces

Constraint is an object that know how to validate individual types of input.
Maybe is an interface that can be used for struct fields which want to differentiate between initialized and uninitialized state.
NumbericConstraint is used to abstract the difference between NumberConstraint (floats) and IntegerConstraint(ints).
RefResolver is a mandatory object that you must pass to a ReferenceConstraint upon its creation.

# Type aliases

JSValSlice is a list of JSVal validators.
No description provided by the author