Documentation
¶
Index ¶
- type ErrCouldNotUnpackToType
- type ErrIncompatibleTypes
- type ErrUnexpectedType
- type ErrUnexpectedTypes
- type KeyValue
- type MapKeyNotFound
- type SliceIndexOutOfRange
- type Type
- type Value
- func (v *Value) Add(other *Value) (*Value, error)
- func (v *Value) Append(val *Value) error
- func (v *Value) BoolValue() (bool, error)
- func (v *Value) Compare(other *Value) (int, error)
- func (v *Value) Copy() (*Value, error)
- func (v *Value) DeleteMapKey(key string) error
- func (v *Value) Divide(other *Value) (*Value, error)
- func (v *Value) Equal(other *Value) (*Value, error)
- func (v *Value) EqualTypeValue(other *Value) (bool, error)
- func (v *Value) FloatValue() (float64, error)
- func (v *Value) GetMapKey(key string) (*Value, error)
- func (v *Value) GetSliceIndex(i int) (*Value, error)
- func (v *Value) GoValue() (any, error)
- func (v *Value) GreaterThan(other *Value) (*Value, error)
- func (v *Value) GreaterThanOrEqual(other *Value) (*Value, error)
- func (v *Value) IntValue() (int64, error)
- func (v *Value) Interface() any
- func (v *Value) IsBool() bool
- func (v *Value) IsBranch() bool
- func (v *Value) IsFloat() bool
- func (v *Value) IsIgnore() bool
- func (v *Value) IsInt() bool
- func (v *Value) IsMap() bool
- func (v *Value) IsNull() bool
- func (v *Value) IsScalar() bool
- func (v *Value) IsSlice() bool
- func (v *Value) IsSpread() bool
- func (v *Value) IsString() bool
- func (v *Value) Kind() reflect.Kind
- func (v *Value) Len() (int, error)
- func (v *Value) LessThan(other *Value) (*Value, error)
- func (v *Value) LessThanOrEqual(other *Value) (*Value, error)
- func (v *Value) MapCopy() (*Value, error)
- func (v *Value) MapKeyExists(key string) (bool, error)
- func (v *Value) MapKeyValues() ([]KeyValue, error)
- func (v *Value) MapKeys() ([]string, error)
- func (v *Value) MapLen() (int, error)
- func (v *Value) MarkAsBranch()
- func (v *Value) MarkAsIgnore()
- func (v *Value) MarkAsSpread()
- func (v *Value) MetadataValue(key string) (any, bool)
- func (v *Value) Modulo(other *Value) (*Value, error)
- func (v *Value) Multiply(other *Value) (*Value, error)
- func (v *Value) NotEqual(other *Value) (*Value, error)
- func (v *Value) RangeMap(f func(string, *Value) error) error
- func (v *Value) RangeSlice(f func(int, *Value) error) error
- func (v *Value) Set(newValue *Value) error
- func (v *Value) SetMapKey(key string, value *Value) error
- func (v *Value) SetMetadataValue(key string, val any)
- func (v *Value) SetSliceIndex(i int, val *Value) error
- func (v *Value) SliceIndexRange(start, end int) (*Value, error)
- func (v *Value) SliceLen() (int, error)
- func (v *Value) String() string
- func (v *Value) StringIndexRange(start, end int) (*Value, error)
- func (v *Value) StringLen() (int, error)
- func (v *Value) StringValue() (string, error)
- func (v *Value) Subtract(other *Value) (*Value, error)
- func (v *Value) Type() Type
- func (v *Value) UnpackKinds(kinds ...reflect.Kind) *Value
- func (v *Value) UnpackUntilAddressable() (*Value, error)
- func (v *Value) UnpackUntilKind(k reflect.Kind) (*Value, error)
- func (v *Value) UnpackUntilKinds(kinds ...reflect.Kind) (*Value, error)
- func (v *Value) UnpackUntilType(t reflect.Type) (*Value, error)
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrCouldNotUnpackToType ¶
func (ErrCouldNotUnpackToType) Error ¶
func (e ErrCouldNotUnpackToType) Error() string
type ErrIncompatibleTypes ¶
ErrIncompatibleTypes is returned when two values are incompatible.
func (ErrIncompatibleTypes) Error ¶
func (e ErrIncompatibleTypes) Error() string
Error returns the error message.
type ErrUnexpectedType ¶
func (ErrUnexpectedType) Error ¶
func (e ErrUnexpectedType) Error() string
type ErrUnexpectedTypes ¶
func (ErrUnexpectedTypes) Error ¶
func (e ErrUnexpectedTypes) Error() string
type MapKeyNotFound ¶
type MapKeyNotFound struct {
Key string
}
MapKeyNotFound is returned when a key is not found in a map.
func (MapKeyNotFound) Error ¶
func (e MapKeyNotFound) Error() string
Error returns the error message.
type SliceIndexOutOfRange ¶
type SliceIndexOutOfRange struct {
Index int
}
SliceIndexOutOfRange is returned when an index is invalid.
func (SliceIndexOutOfRange) Error ¶
func (e SliceIndexOutOfRange) Error() string
Error returns the error message.
type Value ¶
Value represents a value.
func NewBoolValue ¶
NewBoolValue creates a new Value with a bool value.
func NewFloatValue ¶
NewFloatValue creates a new Value with a float value.
func NewIntValue ¶
NewIntValue creates a new Value with an int value.
func NewNestedValue ¶
NewNestedValue creates a new nested value.
func NewStringValue ¶
NewStringValue creates a new Value with a string value.
func (*Value) DeleteMapKey ¶
DeleteMapKey deletes the key from the map.
func (*Value) EqualTypeValue ¶
EqualTypeValue compares two values of the same type.
func (*Value) FloatValue ¶
FloatValue returns the float value of the Value.
func (*Value) GetSliceIndex ¶
GetSliceIndex returns the value at the specified index in the slice.
func (*Value) GreaterThan ¶
GreaterThan compares two values.
func (*Value) GreaterThanOrEqual ¶
GreaterThanOrEqual compares two values.
func (*Value) IsSpread ¶
IsSpread returns true if the value is a spread value. Spread values are used to represent the spread operator.
func (*Value) LessThanOrEqual ¶
LessThanOrEqual compares two values.
func (*Value) MapKeyValues ¶
MapKeyValues returns a list of key value pairs in the map.
func (*Value) MarkAsBranch ¶
func (v *Value) MarkAsBranch()
MarkAsBranch marks the value as a branch value.
func (*Value) MarkAsIgnore ¶
func (v *Value) MarkAsIgnore()
MarkAsIgnore marks the value to be ignored.
func (*Value) MarkAsSpread ¶
func (v *Value) MarkAsSpread()
MarkAsSpread marks the value as a spread value. Spread values are used to represent the spread operator.
func (*Value) MetadataValue ¶
MetadataValue returns a metadata value.
func (*Value) RangeMap ¶
RangeMap iterates over each key in the map and calls the provided function with the key and value.
func (*Value) RangeSlice ¶
RangeSlice iterates over each item in the slice and calls the provided function.
func (*Value) SetMetadataValue ¶
SetMetadataValue sets a metadata value.
func (*Value) SetSliceIndex ¶
SetSliceIndex sets the value at the specified index in the slice.
func (*Value) SliceIndexRange ¶
SliceIndexRange returns a new slice containing the values between the start and end indexes. Comparable to go's slice[start:end].
func (*Value) StringIndexRange ¶
StringIndexRange returns a new string containing the values between the start and end indexes. Comparable to go's string[start:end].
func (*Value) StringValue ¶
StringValue returns the string value of the Value.
func (*Value) UnpackKinds ¶
UnpackKinds unpacks the reflect value until it no longer matches the given kinds.
func (*Value) UnpackUntilAddressable ¶
UnpackUntilAddressable unpacks the reflect value until it is addressable.
func (*Value) UnpackUntilKind ¶
UnpackUntilKind unpacks the reflect value until it matches the given kind.
func (*Value) UnpackUntilKinds ¶
UnpackUntilKinds unpacks the reflect value until it matches the given kind.