constant

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 1 Imported by: 1 module, 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 ByDirectURL added in v2.1.0

type ByDirectURL string // Always "by_direct_url"

func (ByDirectURL) Default added in v2.1.0

func (c ByDirectURL) Default() ByDirectURL

func (ByDirectURL) MarshalJSON added in v2.1.0

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

type ByDomain

type ByDomain string // Always "by_domain"

func (ByDomain) Default

func (c ByDomain) Default() ByDomain

func (ByDomain) MarshalJSON

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

type ByEmail

type ByEmail string // Always "by_email"

func (ByEmail) Default

func (c ByEmail) Default() ByEmail

func (ByEmail) MarshalJSON

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

type ByName

type ByName string // Always "by_name"

func (ByName) Default

func (c ByName) Default() ByName

func (ByName) MarshalJSON

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

type ByTicker

type ByTicker string // Always "by_ticker"

func (ByTicker) Default

func (c ByTicker) Default() ByTicker

func (ByTicker) MarshalJSON

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

type ByTransaction

type ByTransaction string // Always "by_transaction"

func (ByTransaction) Default

func (c ByTransaction) Default() ByTransaction

func (ByTransaction) MarshalJSON

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

type Constant

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

type Exact

type Exact string // Always "exact"

func (Exact) Default

func (c Exact) Default() Exact

func (Exact) MarshalJSON

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

type Extract

type Extract string // Always "extract"

func (Extract) Default

func (c Extract) Default() Extract

func (Extract) MarshalJSON

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

type Page

type Page string // Always "page"

func (Page) Default

func (c Page) Default() Page

func (Page) MarshalJSON

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

type Semantic

type Semantic string // Always "semantic"

func (Semantic) Default

func (c Semantic) Default() Semantic

func (Semantic) MarshalJSON

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

type Sitemap

type Sitemap string // Always "sitemap"

func (Sitemap) Default

func (c Sitemap) Default() Sitemap

func (Sitemap) MarshalJSON

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

Jump to

Keyboard shortcuts

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