values

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 9 Imported by: 5 modules, 16 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Proto

func Proto(v Value) *pb.Value

func ProtoMap

func ProtoMap(v *Map) *pb.Map

func Unwrap

func Unwrap(v Value) (any, error)

Types

type BigInt

type BigInt struct {
	Underlying *big.Int
}

func NewBigInt

func NewBigInt(b *big.Int) *BigInt

func (*BigInt) Copy added in v0.3.0

func (b *BigInt) Copy() Value

func (*BigInt) Unwrap

func (b *BigInt) Unwrap() (any, error)

func (*BigInt) UnwrapTo

func (b *BigInt) UnwrapTo(to any) error

type Bool

type Bool struct {
	Underlying bool
}

func NewBool

func NewBool(b bool) *Bool

func (*Bool) Copy added in v0.3.0

func (b *Bool) Copy() Value

func (*Bool) Unwrap

func (b *Bool) Unwrap() (any, error)

func (*Bool) UnwrapTo

func (b *Bool) UnwrapTo(to any) error

type Bytes

type Bytes struct {
	Underlying []byte
}

func NewBytes

func NewBytes(b []byte) *Bytes

func (*Bytes) Copy added in v0.3.0

func (b *Bytes) Copy() Value

func (*Bytes) Unwrap

func (b *Bytes) Unwrap() (any, error)

func (*Bytes) UnwrapTo

func (b *Bytes) UnwrapTo(to any) error

type Decimal

type Decimal struct {
	Underlying decimal.Decimal
}

func NewDecimal

func NewDecimal(d decimal.Decimal) *Decimal

func (*Decimal) Copy added in v0.3.0

func (d *Decimal) Copy() Value

func (*Decimal) Unwrap

func (d *Decimal) Unwrap() (any, error)

func (*Decimal) UnwrapTo

func (d *Decimal) UnwrapTo(to any) error

type Int64

type Int64 struct {
	Underlying int64
}

func NewInt64

func NewInt64(i int64) *Int64

func (*Int64) Copy added in v0.3.0

func (i *Int64) Copy() Value

func (*Int64) Unwrap

func (i *Int64) Unwrap() (any, error)

func (*Int64) UnwrapTo

func (i *Int64) UnwrapTo(to any) error

type List

type List struct {
	Underlying []Value
}

func FromListValueProto

func FromListValueProto(lv *pb.List) (*List, error)

func NewList

func NewList(l []any) (*List, error)

func (*List) Copy added in v0.3.0

func (l *List) Copy() Value

func (*List) CopyList

func (l *List) CopyList() *List

func (*List) Unwrap

func (l *List) Unwrap() (any, error)

func (*List) UnwrapTo

func (l *List) UnwrapTo(to any) error

type Map

type Map struct {
	Underlying map[string]Value
}

func CreateMapFromStruct

func CreateMapFromStruct(v any) (*Map, error)

func EmptyMap

func EmptyMap() *Map

func FromMapValueProto

func FromMapValueProto(mv *pb.Map) (*Map, error)

func NewMap

func NewMap(m map[string]any) (*Map, error)

func WrapMap

func WrapMap(a any) (*Map, error)

func (*Map) Copy added in v0.3.0

func (m *Map) Copy() Value

func (*Map) CopyMap

func (m *Map) CopyMap() *Map

func (*Map) DeleteAtPath

func (m *Map) DeleteAtPath(path string) bool

DeleteAtPath deletes a value from a map at a given dot separated path. Returns true if an element at the given path was found and deleted, false otherwise.

func (*Map) Unwrap

func (m *Map) Unwrap() (any, error)

func (*Map) UnwrapTo

func (m *Map) UnwrapTo(to any) error

type String

type String struct {
	Underlying string
}

func NewString

func NewString(s string) *String

func (*String) Copy added in v0.3.0

func (s *String) Copy() Value

func (*String) Unwrap

func (s *String) Unwrap() (any, error)

func (*String) UnwrapTo

func (s *String) UnwrapTo(to any) error

type Unwrappable

type Unwrappable interface {
	Unwrap() (any, error)
	UnwrapTo(any) error
}

type Value

type Value interface {
	Copy() Value
	Unwrappable
	// contains filtered or unexported methods
}

func FromProto

func FromProto(val *pb.Value) (Value, error)

func Wrap

func Wrap(v any) (Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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