constant

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 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 Constant

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

type Exact added in v1.4.0

type Exact string // Always "exact"

func (Exact) Default added in v1.4.0

func (c Exact) Default() Exact

func (Exact) MarshalJSON added in v1.4.0

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

type Extract added in v1.4.0

type Extract string // Always "extract"

func (Extract) Default added in v1.4.0

func (c Extract) Default() Extract

func (Extract) MarshalJSON added in v1.4.0

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

type Page added in v1.4.0

type Page string // Always "page"

func (Page) Default added in v1.4.0

func (c Page) Default() Page

func (Page) MarshalJSON added in v1.4.0

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

type Semantic added in v1.4.0

type Semantic string // Always "semantic"

func (Semantic) Default added in v1.4.0

func (c Semantic) Default() Semantic

func (Semantic) MarshalJSON added in v1.4.0

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

type Sitemap added in v1.4.0

type Sitemap string // Always "sitemap"

func (Sitemap) Default added in v1.4.0

func (c Sitemap) Default() Sitemap

func (Sitemap) MarshalJSON added in v1.4.0

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

Jump to

Keyboard shortcuts

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