values

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 10 Imported by: 44

README

About this package

This package is separate from the main module, so it can be imported by the CRE SDK without unnecessary dependencies.

To update the chainlink-protos commit, update the variable chainlinkProtosVersion in installer/pkg/consts.go.

installer

Use the installer package to ensure that the chainlink-protos commit always matches the version used in this package.

ProtocGen

The ProtocGen struct allows you to directly compile a file or to specify a CRE capabilities using a helper CapabilityConfig.

Use of the CapabilityConfig requires the ProtocHelper field to be set.

The CRE uses the chainlink-protos repository, especially, and capabilities are used in both the cre-sdk-go and capabilities repositories. Adding a different package with its own go.mod to isolate that logic would require an extra commit in this repository to update the protos repository. The first would be to update this package, the second to update the consumer.

InstallProtocGenToDir

This function allows you to install additional plugins for protoc. See comments on the function for more information.

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 ProtoToBigInt

func ProtoToBigInt(biv *pb.BigInt) *big.Int

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 Float64

type Float64 struct {
	Underlying float64
}

func NewFloat64

func NewFloat64(f float64) *Float64

func (*Float64) Unwrap

func (f *Float64) Unwrap() (any, error)

func (*Float64) UnwrapTo

func (f *Float64) 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, error)

func NewList

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

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[T any](m map[string]T) (*Map, error)

func WrapMap

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

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) Unwrap

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

func (*String) UnwrapTo

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

type Time

type Time struct {
	Underlying time.Time
}

func NewTime

func NewTime(t time.Time) *Time

func (*Time) Unwrap

func (t *Time) Unwrap() (any, error)

func (*Time) UnwrapTo

func (t *Time) UnwrapTo(to any) error

type Uint64

type Uint64 struct {
	Underlying uint64
}

func NewUint64

func NewUint64(i uint64) *Uint64

func (*Uint64) Unwrap

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

func (*Uint64) UnwrapTo

func (i *Uint64) 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 Copy

func Copy(v Value) Value

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