validation

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContextObject

func GetContextObject[T any](o *Options) *T

func NewMapKeyError added in v0.2.1

func NewMapKeyError(msg string, core CoreModeler, node mapKeyNodeGetter, key string) error

func NewMapValueError added in v0.2.1

func NewMapValueError(msg string, core CoreModeler, node mapValueNodeGetter, key string) error

func NewNodeError added in v0.2.1

func NewNodeError(msg string, node *yaml.Node) error

func NewSliceError added in v0.2.1

func NewSliceError(msg string, core CoreModeler, node sliceNodeGetter, index int) error

func NewValueError added in v0.2.1

func NewValueError(msg string, core CoreModeler, node valueNodeGetter) error

Types

type CoreModeler added in v0.2.1

type CoreModeler interface {
	GetRootNode() *yaml.Node
}

type Error

type Error struct {
	Line    int
	Column  int
	Message string
}

Error represents a validation error and the line and column where it occurred TODO allow getting the JSON path for line/column for validation errors

func (Error) Error

func (e Error) Error() string

type Option

type Option func(o *Options)

func WithContextObject

func WithContextObject[T any](obj *T) Option

type Options

type Options struct {
	ContextObjects map[reflect.Type]any
}

func NewOptions

func NewOptions(opts ...Option) *Options

Jump to

Keyboard shortcuts

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