constant

package
v0.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT 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 Constant

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

type File

type File string // Always "file"

func (File) Default

func (c File) Default() File

func (File) MarshalJSON

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

type List

type List string // Always "list"

func (List) Default

func (c List) Default() List

func (List) MarshalJSON

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

type StructuredSheet

type StructuredSheet string // Always "structured_sheet"

func (StructuredSheet) Default

func (c StructuredSheet) Default() StructuredSheet

func (StructuredSheet) MarshalJSON

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

type Table

type Table string // Always "table"

func (Table) Default

func (c Table) Default() Table

func (Table) MarshalJSON

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

Jump to

Keyboard shortcuts

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