validation

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: PostgreSQL Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnique = errors.New("must be unique")

Functions

func ArrayIndexElement

func ArrayIndexElement(idx int) string

func MapKeyElement

func MapKeyElement(key string) string

Types

type Error

type Error struct {
	Path Path
	Err  error
}

func NewError

func NewError(err error, path Path) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Path

type Path []string

func NewPath

func NewPath(elems ...string) Path

func (Path) Append

func (p Path) Append(elem ...string) Path

func (Path) AppendArrayIndex

func (p Path) AppendArrayIndex(idx int) Path

func (Path) AppendMapKey

func (p Path) AppendMapKey(key string) Path

func (Path) String

func (p Path) String() string

type Unique

type Unique[T cmp.Ordered] struct {
	// contains filtered or unexported fields
}

func NewUnique

func NewUnique[T cmp.Ordered]() *Unique[T]

func (*Unique[T]) RecordSeen

func (u *Unique[T]) RecordSeen(path Path, value T)

func (*Unique[T]) Validate

func (u *Unique[T]) Validate(base error) []error

Jump to

Keyboard shortcuts

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