validate

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Validator

type Validator interface {
	Validate(*map[string]any) error
}

func NewValidator

func NewValidator(validators map[tree.Path]ValidatorFunc) Validator

NewValidator creates a new validator with the given validators.

type ValidatorFunc

type ValidatorFunc func(*map[string]any, any, tree.Path) error

ValidatorFunc is a function that validates a part of the configuration. It takes the root configuration, the data to validate and the current path in the tree.

type ValidatorImpl

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

ValidatorImpl is the implementation of the Validator interface.

func (ValidatorImpl) Validate

func (v ValidatorImpl) Validate(rawConfig *map[string]any) error

Validate applies the validators to the configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳