constant

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 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 Completed

type Completed string // Always "completed"

func (Completed) Default

func (c Completed) Default() Completed

func (Completed) MarshalJSON

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

type Constant

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

type Git added in v0.25.0

type Git string // Always "git"

func (Git) Default added in v0.25.0

func (c Git) Default() Git

func (Git) MarshalJSON added in v0.25.0

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

type InProgress

type InProgress string // Always "in_progress"

func (InProgress) Default

func (c InProgress) Default() InProgress

func (InProgress) MarshalJSON

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

type Markdown added in v0.25.0

type Markdown string // Always "markdown"

func (Markdown) Default added in v0.25.0

func (c Markdown) Default() Markdown

func (Markdown) MarshalJSON added in v0.25.0

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

type NotStarted

type NotStarted string // Always "not_started"

func (NotStarted) Default

func (c NotStarted) Default() NotStarted

func (NotStarted) MarshalJSON

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

type Queued

type Queued string // Always "queued"

func (Queued) Default

func (c Queued) Default() Queued

func (Queued) MarshalJSON

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

type Raw added in v0.25.0

type Raw string // Always "raw"

func (Raw) Default added in v0.25.0

func (c Raw) Default() Raw

func (Raw) MarshalJSON added in v0.25.0

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

type URL added in v0.25.0

type URL string // Always "url"

func (URL) Default added in v0.25.0

func (c URL) Default() URL

func (URL) MarshalJSON added in v0.25.0

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

Jump to

Keyboard shortcuts

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