validate

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package validate provides small, generic request validators for MCP tools.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmpty = errors.New("empty value")

ErrEmpty is wrapped with the field name when a required value is blank.

View Source
var ErrZero = errors.New("zero value")

ErrZero is wrapped with the field name when a required value is the zero T.

Functions

func RequireNonEmpty

func RequireNonEmpty(field, value string) error

RequireNonEmpty wraps ErrEmpty, naming field, when value is blank (trimmed).

func RequireNonZero

func RequireNonZero[T comparable](field string, value T) error

RequireNonZero wraps ErrZero, naming field, when value is the zero of T.

Types

This section is empty.

Jump to

Keyboard shortcuts

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