validate

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package validate provides standard Validator constructors for cfg configuration fields. Each constructor returns a cfg.Validator whose Describe reports its kind and parameters so the schema commands and editor tooling can render the constraint declaratively rather than as an opaque function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(vs ...cfg.Validator) cfg.Validator

All returns a validator that runs each child in order. The first failure stops the chain.

func Func

func Func(description string, fn func(any) error) cfg.Validator

Func returns a validator backed by an arbitrary Go function. The description tells operators and editor tooling what the function checks, since the function body itself is opaque to introspection.

func Pattern

func Pattern(re string) cfg.Validator

Pattern returns a validator that requires a string value to match a regular expression. The pattern compiles at construction; a malformed pattern panics.

func Range

func Range(min, max int64) cfg.Validator

Range returns a validator that requires an integer value to fall within [min, max] inclusive.

Types

This section is empty.

Jump to

Keyboard shortcuts

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