Documentation ¶
Index ¶
- Variables
- func GetConcretValue[T any](v *Value) *T
- func Length(v *Value) (int, error)
- func MustStringValueMapFromProto(m map[string]*pbvalues.Value) map[string]*Value
- func SetCallIssuer(v *Value, issuer string) error
- func StringValueMapFromProto(m map[string]*pbvalues.Value) (map[string]*Value, error)
- func StringValueMapToProto(m map[string]*Value) map[string]*pbvalues.Value
- func Take(v *Value, idx, count int) (*Value, []*Value, error)
- func Unwrap(v value, fopts ...func(*unwrapOpts)) interface{}
- func UnwrapInto(dst interface{}, v value, fopts ...func(*unwrapOpts)) error
- func UnwrapValuesMap(m map[string]*Value, fopts ...func(*unwrapOpts)) map[string]interface{}
- func ValuesListToProto(vs []*Value) []*pbvalues.Value
- func Walk(v *Value, f func(curr, parent *Value, role Role) error) error
- func WithDictSorter(s func([]*DictItem)) func(*wrapOpts)
- func WithListSorter(s func([]*Value)) func(*wrapOpts)
- func WithStructFieldNameConverter(f func(string) string) func(*wrapOpts)
- func WithUnwrapJSONSafe() func(*unwrapOpts)
- func WithWrapTranslate(t func(interface{}) (interface{}, error)) func(*wrapOpts)
- func WrapIntoValuesMap(dst map[string]*Value, v interface{}, wopts ...func(*wrapOpts)) error
- func WrapValuesMap(dst map[string]*Value, m map[string]interface{}, wopts ...func(*wrapOpts)) error
- type BooleanValue
- type BytesValue
- type CallValue
- type DictItem
- type DictValue
- type DurationValue
- type FloatValue
- type FunctionSignature
- type FunctionValue
- type IntegerValue
- type ListValue
- type ModuleValue
- type NoneValue
- type Role
- type SetValue
- type StringValue
- type StructValue
- type SymbolValue
- type TimeValue
- type Value
- func Add(a, b *Value) (*Value, error)
- func Boolean(b bool) *Value
- func Bytes(bs []byte) *Value
- func Dict(items ...*DictItem) *Value
- func DictFromMap(m map[string]*Value) *Value
- func Div(a, b *Value) (*Value, error)
- func Duration(d time.Duration) *Value
- func Float(f float32) *Value
- func Foldr(f func(a, b *Value) (*Value, error), v0 *Value, vs []*Value) (*Value, error)
- func GetKey(v, k *Value) (*Value, error)
- func Inc(v *Value, amount int64) (*Value, error)
- func Index(v *Value, idx int) (*Value, error)
- func Insert(v *Value, idx int, vv *Value) (*Value, error)
- func Integer(i int64) *Value
- func Keys(v *Value) (*Value, error)
- func List(items ...*Value) *Value
- func Module(name string, members map[string]*Value) *Value
- func Mul(a, b *Value) (*Value, error)
- func MustNewValue(v value) *Value
- func MustValueFromProto(pb *pbvalues.Value) *Value
- func MustValuesListFromProto(pbs []*pbvalues.Value) []*Value
- func MustWrap(v interface{}, wopts ...func(*wrapOpts)) *Value
- func NewValue(v value) (*Value, error)
- func Set(vs ...*Value) *Value
- func SetKey(v, kv, vv *Value) (*Value, error)
- func String(s string) *Value
- func StringList(items ...string) *Value
- func Struct(ctor *Value, fields map[string]*Value) *Value
- func Symbol(s string) *Value
- func Time(t time.Time) *Value
- func ValueFromProto(pb *pbvalues.Value) (*Value, error)
- func ValuesListFromProto(pbs []*pbvalues.Value) ([]*Value, error)
- func Wrap(v interface{}, wopts ...func(*wrapOpts)) (*Value, error)
- func (v *Value) Clone() *Value
- func (v *Value) Equal(o *Value) bool
- func (v *Value) Get() value
- func (v *Value) IsEphemeral() bool
- func (v *Value) MarshalJSON() ([]byte, error)
- func (v *Value) PB() *pbvalues.Value
- func (v *Value) String() string
- func (v *Value) UnmarshalJSON(bs []byte) error
- func (v *Value) Unwrap(fopts ...func(*unwrapOpts)) interface{}
- type ValuePB
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOutOfRange = errors.New("out of range") ErrIncompatibleValue = errors.New("incompatible value") )
View Source
var ( // Ignore current value's children. ErrSkip = errors.New("skip") // Abort scanning of current fields of parent and continue to parent sibling, if exists. ErrUp = errors.New("up") )
View Source
var ErrNoConversion = errors.New("no convertion")
View Source
var ErrUnknownType = errors.New("(proto) unknown type")
View Source
var None = MustNewValue(NoneValue{})
Functions ¶
func GetConcretValue ¶
func StringValueMapFromProto ¶
func StringValueMapToProto ¶
func UnwrapInto ¶
func UnwrapInto(dst interface{}, v value, fopts ...func(*unwrapOpts)) error
func UnwrapValuesMap ¶
func ValuesListToProto ¶
func WithDictSorter ¶
func WithDictSorter(s func([]*DictItem)) func(*wrapOpts)
func WithListSorter ¶
func WithListSorter(s func([]*Value)) func(*wrapOpts)
func WithUnwrapJSONSafe ¶
func WithUnwrapJSONSafe() func(*unwrapOpts)
func WithWrapTranslate ¶
func WithWrapTranslate(t func(interface{}) (interface{}, error)) func(*wrapOpts)
func WrapIntoValuesMap ¶
Types ¶
type BooleanValue ¶
type BooleanValue bool
func (*BooleanValue) ConvertFrom ¶
func (b *BooleanValue) ConvertFrom(v value) error
func (BooleanValue) String ¶
func (b BooleanValue) String() string
type BytesValue ¶
type BytesValue []byte
func (*BytesValue) ConvertFrom ¶
func (b *BytesValue) ConvertFrom(v value) error
func (BytesValue) String ¶
func (b BytesValue) String() string
type CallValue ¶
type CallValue struct { Name string `json:"name"` ID string `json:"id"` Issuer string `json:"issuer"` Flags map[string]bool `json:"flags"` // set only by ak. not by user. }
func GetCallValue ¶
type DictValue ¶
type DictValue []*DictItem
func GetDictValue ¶
func (*DictValue) ConvertFrom ¶
func (DictValue) ToStringValuesMap ¶
type DurationValue ¶
func (*DurationValue) ConvertFrom ¶
func (d *DurationValue) ConvertFrom(v value) error
func (DurationValue) String ¶
func (d DurationValue) String() string
func (DurationValue) UnwrapInto ¶
func (d DurationValue) UnwrapInto(dst interface{}) (bool, error)
type FloatValue ¶
type FloatValue float32
func (*FloatValue) ConvertFrom ¶
func (f *FloatValue) ConvertFrom(v value) error
func (FloatValue) IsIntegral ¶
func (f FloatValue) IsIntegral() bool
func (FloatValue) String ¶
func (f FloatValue) String() string
func (FloatValue) UnwrapInto ¶
func (f FloatValue) UnwrapInto(dst interface{}) (bool, error)
type FunctionSignature ¶
type FunctionValue ¶
type FunctionValue struct { Lang string `json:"lang"` FuncID string `json:"func_id"` Scope string `json:"scope"` Signature *FunctionSignature `json:"signature"` // optional }
func GetFunctionValue ¶
func GetFunctionValue(v *Value) *FunctionValue
func ParseFunctionValueString ¶
func ParseFunctionValueString(s string) (*FunctionValue, error)
func (FunctionValue) String ¶
func (c FunctionValue) String() string
type IntegerValue ¶
type IntegerValue int64
func (*IntegerValue) ConvertFrom ¶
func (i *IntegerValue) ConvertFrom(v value) error
func (IntegerValue) String ¶
func (i IntegerValue) String() string
func (IntegerValue) UnwrapInto ¶
func (i IntegerValue) UnwrapInto(dst interface{}) (bool, error)
type ModuleValue ¶
func GetModuleValue ¶
func GetModuleValue(v *Value) *ModuleValue
func (ModuleValue) String ¶
func (c ModuleValue) String() string
type StringValue ¶
type StringValue string
func (*StringValue) ConvertFrom ¶
func (s *StringValue) ConvertFrom(v value) error
func (StringValue) String ¶
func (s StringValue) String() string
func (StringValue) UnwrapInto ¶
func (s StringValue) UnwrapInto(dst interface{}) (bool, error)
type StructValue ¶
func GetStructValue ¶
func GetStructValue(v *Value) *StructValue
func (StructValue) String ¶
func (s StructValue) String() string
type SymbolValue ¶
type SymbolValue string
func (*SymbolValue) ConvertFrom ¶
func (s *SymbolValue) ConvertFrom(v value) error
func (SymbolValue) String ¶
func (s SymbolValue) String() string
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func DictFromMap ¶
func MustNewValue ¶
func MustNewValue(v value) *Value
func MustValueFromProto ¶
func MustValuesListFromProto ¶
func StringList ¶
func (*Value) IsEphemeral ¶
func (*Value) MarshalJSON ¶
func (*Value) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.