ukdec

package
v0.0.0-...-c75472b Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidField = errors.New("invalid field error")
	ErrUnknownField = errors.New("unknown field error")
)

Functions

func Decode

func Decode(input ukcore.Input, params any, opts ...Option) error

func DecodeFor

func DecodeFor[Params any](input ukcore.Input, opts ...Option) (Params, error)

Types

type Config

type Config struct {
	// TODO: Document
	Log *slog.Logger

	// TODO: Document
	Spec []ukspec.Option
}

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder(input ukcore.Input, opts ...Option) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode(params any) error

type InvalidFieldError

type InvalidFieldError[S any] struct {
	Source      S
	Destination reflect.Type
	// contains filtered or unexported fields
}

func (InvalidFieldError[S]) Error

func (e InvalidFieldError[S]) Error() string

func (InvalidFieldError[S]) Is

func (e InvalidFieldError[S]) Is(t error) bool

func (InvalidFieldError[S]) Unwrap

func (e InvalidFieldError[S]) Unwrap() error

type InvalidParametersError

type InvalidParametersError struct {
	Type reflect.Type
	// contains filtered or unexported fields
}

func (InvalidParametersError) Error

func (e InvalidParametersError) Error() string

func (InvalidParametersError) Is

func (InvalidParametersError) Unwrap

func (e InvalidParametersError) Unwrap() error

type Option

type Option interface{ UkaseApplyDec(*Config) }

type UnknownFieldError

type UnknownFieldError[S any] struct {
	Source S
	// contains filtered or unexported fields
}

func (UnknownFieldError[S]) Error

func (e UnknownFieldError[S]) Error() string

func (UnknownFieldError[S]) Is

func (e UnknownFieldError[S]) Is(t error) bool

func (UnknownFieldError[S]) Unwrap

func (e UnknownFieldError[S]) Unwrap() error

Jump to

Keyboard shortcuts

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