validate

package
v0.163.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiConfig

func ApiConfig(api *apihandler.Api) (bool, []string)

ApiConfig validates the Api

Types

type ValidationFunc

type ValidationFunc func(v *Validator) (valid bool, messages []string)

func Length

func Length(length int) ValidationFunc

func MaxLength

func MaxLength(maxLength int) ValidationFunc

func MinLength

func MinLength(minLength int) ValidationFunc

func Required

func Required() ValidationFunc

type Validator

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

func NewValidator

func NewValidator(configPath string, data any) *Validator

NewValidator returns a new Validator. The configPath is the path to the config value that is being validated.

func (*Validator) Validate

func (v *Validator) Validate(validatorFunc ...ValidationFunc) (valid bool, messages []string)

Jump to

Keyboard shortcuts

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