constant

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValueOf

func ValueOf[T Constant[T]]() T

ValueOf gives the default value of a constant from its type. It's helpful when constructing constants as variants in a one-of. Note that empty structs are marshalled by default. Usage: constant.ValueOf[constant.Foo]()

Types

type Collateral

type Collateral string // Always "collateral"

func (Collateral) Default

func (c Collateral) Default() Collateral

func (Collateral) MarshalJSON

func (c Collateral) MarshalJSON() ([]byte, error)

type Constant

type Constant[T any] interface {
	Default() T
}

type Fee

type Fee string // Always "fee"

func (Fee) Default

func (c Fee) Default() Fee

func (Fee) MarshalJSON

func (c Fee) MarshalJSON() ([]byte, error)

type Payment

type Payment string // Always "payment"

func (Payment) Default

func (c Payment) Default() Payment

func (Payment) MarshalJSON

func (c Payment) MarshalJSON() ([]byte, error)

type Spend

type Spend string // Always "spend"

func (Spend) Default

func (c Spend) Default() Spend

func (Spend) MarshalJSON

func (c Spend) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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