constant

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 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 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 Album

type Album string // Always "album"

func (Album) Default

func (c Album) Default() Album

func (Album) MarshalJSON

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

type Artist

type Artist string // Always "artist"

func (Artist) Default

func (c Artist) Default() Artist

func (Artist) MarshalJSON

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

type Audiobook

type Audiobook string // Always "audiobook"

func (Audiobook) Default

func (c Audiobook) Default() Audiobook

func (Audiobook) MarshalJSON

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

type Constant

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

type Episode

type Episode string // Always "episode"

func (Episode) Default

func (c Episode) Default() Episode

func (Episode) MarshalJSON

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

type Show

type Show string // Always "show"

func (Show) Default

func (c Show) Default() Show

func (Show) MarshalJSON

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

Jump to

Keyboard shortcuts

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