values

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 7 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 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) 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) 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) 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) 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) 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

func NewList

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

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 EmptyMap

func EmptyMap() *Map

func FromMapValueProto

func FromMapValueProto(mv *pb.Map) *Map

func NewMap

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

func WrapMap

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

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) 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 {
	Unwrappable
	// contains filtered or unexported methods
}

func FromProto

func FromProto(val *pb.Value) Value

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