validate

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 3 Imported by: 0

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