validators

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 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 ValidationErrors

type ValidationErrors interface {
	//
	// HasError returns true if an error exist for the specific field.
	//
	HasError(field string) bool

	//
	// GetError returns the error string for the specific field.
	//
	GetError(field string) string
}

ValidationErrors provides an interface to interact with validation specific errors.

type Validator

type Validator interface {
	//
	// GetErrors returns a map of errors with corresponding field.
	//
	GetErrors() ValidationErrors

	//
	// Validate returns a boolean state to indicate valid or non-valid state.
	//
	Validate() bool
}

Validator provides Validate and GetErrors methods to initiate a validation process.

func NewValidator

func NewValidator(
	integration *receivers.Spec,
	templateCtx *templates.TemplateContext) Validator

NewValidator returns an instance of validator.

Jump to

Keyboard shortcuts

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