validator

package
v0.0.0-...-4995b57 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package validator implements an input plugin that derives a CUE IR from go-playground/validator struct tags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constraint

type Constraint struct {
	Key   string  `@Ident`
	Param *string `( Eq @ParamValue )?`
}

Constraint is a single validator keyword with an optional parameter, e.g. "gte=0" or "required".

type Tag

type Tag struct {
	Terms []*Term `@@ ( Comma @@ )*`
}

Tag is a parsed go-playground/validator struct tag: comma-separated terms, each a pipe-separated list of OR alternatives.

func ParseTag

func ParseTag(s string) (*Tag, error)

ParseTag parses a go-playground/validator struct tag value.

type Term

type Term struct {
	Alts []*Constraint `@@ ( Or @@ )*`
}

Term is one comma-separated term and its OR alternatives.

Jump to

Keyboard shortcuts

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