constant

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 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 ByContinuingYouAgreeToTheTermsOfUseAndAcknowledgeThePrivacyPolicy added in v5.0.1

type ByContinuingYouAgreeToTheTermsOfUseAndAcknowledgeThePrivacyPolicy string // Always "By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy."

func (ByContinuingYouAgreeToTheTermsOfUseAndAcknowledgeThePrivacyPolicy) Default added in v5.0.1

func (ByContinuingYouAgreeToTheTermsOfUseAndAcknowledgeThePrivacyPolicy) MarshalJSON added in v5.0.1

type Cancelled added in v5.0.1

type Cancelled string // Always "cancelled"

func (Cancelled) Default added in v5.0.1

func (c Cancelled) Default() Cancelled

func (Cancelled) MarshalJSON added in v5.0.1

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

type ChooseYourUsername added in v5.0.1

type ChooseYourUsername string // Always "Choose your username"

func (ChooseYourUsername) Default added in v5.0.1

func (ChooseYourUsername) MarshalJSON added in v5.0.1

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

type Complete added in v5.0.1

type Complete string // Always "complete"

func (Complete) Default added in v5.0.1

func (c Complete) Default() Complete

func (Complete) MarshalJSON added in v5.0.1

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

type Constant

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

type Continue added in v5.0.1

type Continue string // Always "Continue"

func (Continue) Default added in v5.0.1

func (c Continue) Default() Continue

func (Continue) MarshalJSON added in v5.0.1

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

type Cookies added in v5.0.1

type Cookies string // Always "cookies"

func (Cookies) Default added in v5.0.1

func (c Cookies) Default() Cookies

func (Cookies) MarshalJSON added in v5.0.1

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

type DisplayAndWait added in v5.0.1

type DisplayAndWait string // Always "display_and_wait"

func (DisplayAndWait) Default added in v5.0.1

func (c DisplayAndWait) Default() DisplayAndWait

func (DisplayAndWait) MarshalJSON added in v5.0.1

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

type Emoji added in v5.0.1

type Emoji string // Always "emoji"

func (Emoji) Default added in v5.0.1

func (c Emoji) Default() Emoji

func (Emoji) MarshalJSON added in v5.0.1

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

type Nothing added in v5.0.1

type Nothing string // Always "nothing"

func (Nothing) Default added in v5.0.1

func (c Nothing) Default() Nothing

func (Nothing) MarshalJSON added in v5.0.1

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

type Qr added in v5.0.1

type Qr string // Always "qr"

func (Qr) Default added in v5.0.1

func (c Qr) Default() Qr

func (Qr) MarshalJSON added in v5.0.1

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

type UserInput added in v5.0.1

type UserInput string // Always "user_input"

func (UserInput) Default added in v5.0.1

func (c UserInput) Default() UserInput

func (UserInput) MarshalJSON added in v5.0.1

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

type Username added in v5.0.1

type Username string // Always "Username"

func (Username) Default added in v5.0.1

func (c Username) Default() Username

func (Username) MarshalJSON added in v5.0.1

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

Jump to

Keyboard shortcuts

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