eval

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntValue

func IntValue(val any) (int, error)

func Select

func Select(ctx context.Context, parameter, elem any) (out any, err error)

func SelectField

func SelectField(parameter, field any) (name string, value any, err error)

func SelectIndex

func SelectIndex(parameter []any, idx any) (offset int, value any, err error)

func SelectKey

func SelectKey(parameter map[string]any, key any) (name string, value any, err error)

func Selector

func Selector(path gval.Evaluables) gval.Evaluable

func StringValue

func StringValue(val any) (string, error)

Types

type IndexOutOfBoundsError

type IndexOutOfBoundsError struct {
	Index int
}

func (*IndexOutOfBoundsError) Error

func (e *IndexOutOfBoundsError) Error() string

type Indexable

type Indexable interface {
	Index(ctx context.Context, idx any) (any, error)
}

type UnexpectedIndexTypeError

type UnexpectedIndexTypeError struct {
	RawIndex any
}

func (*UnexpectedIndexTypeError) Error

func (e *UnexpectedIndexTypeError) Error() string

type UnexpectedKeyTypeError

type UnexpectedKeyTypeError struct {
	RawKey any
}

func (*UnexpectedKeyTypeError) Error

func (e *UnexpectedKeyTypeError) Error() string

type UnexpectedStringIndexError

type UnexpectedStringIndexError struct {
	RawIndex string
	Cause    error
}

func (*UnexpectedStringIndexError) Error

func (*UnexpectedStringIndexError) Unwrap

func (e *UnexpectedStringIndexError) Unwrap() error

type UnknownFieldError

type UnknownFieldError struct {
	Field string
}

func (*UnknownFieldError) Error

func (e *UnknownFieldError) Error() string

type UnknownKeyError

type UnknownKeyError struct {
	Key string
}

func (*UnknownKeyError) Error

func (e *UnknownKeyError) Error() string

type UnsupportedValueTypeError

type UnsupportedValueTypeError struct {
	Value any
	Field any
}

func (*UnsupportedValueTypeError) Error

func (e *UnsupportedValueTypeError) Error() string

Jump to

Keyboard shortcuts

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