Help us shape the future of Go! Take the 2026 Go Developer Survey

constant

package
v2.31.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 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 Batch added in v2.15.0

type Batch string // Always "batch"

func (Batch) Default added in v2.15.0

func (c Batch) Default() Batch

func (Batch) MarshalJSON added in v2.15.0

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

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 Candidate added in v2.9.0

type Candidate string // Always "candidate"

func (Candidate) Default added in v2.9.0

func (c Candidate) Default() Candidate

func (Candidate) MarshalJSON added in v2.9.0

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

type Constant

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

type Crawl added in v2.9.0

type Crawl string // Always "crawl"

func (Crawl) Default added in v2.9.0

func (c Crawl) Default() Crawl

func (Crawl) MarshalJSON added in v2.9.0

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

type Domain added in v2.10.0

type Domain string // Always "domain"

func (Domain) Default added in v2.10.0

func (c Domain) Default() Domain

func (Domain) MarshalJSON added in v2.10.0

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

type Entity added in v2.30.0

type Entity string // Always "entity"

func (Entity) Default added in v2.30.0

func (c Entity) Default() Entity

func (Entity) MarshalJSON added in v2.30.0

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

type Error added in v2.6.0

type Error string // Always "error"

func (Error) Default added in v2.6.0

func (c Error) Default() Error

func (Error) MarshalJSON added in v2.6.0

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

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 Existing added in v2.25.0

type Existing string // Always "existing"

func (Existing) Default added in v2.25.0

func (c Existing) Default() Existing

func (Existing) MarshalJSON added in v2.25.0

func (c Existing) 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 Isin added in v2.10.0

type Isin string // Always "isin"

func (Isin) Default added in v2.10.0

func (c Isin) Default() Isin

func (Isin) MarshalJSON added in v2.10.0

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

type Monitor added in v2.15.0

type Monitor string // Always "monitor"

func (Monitor) Default added in v2.15.0

func (c Monitor) Default() Monitor

func (Monitor) MarshalJSON added in v2.15.0

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

type Name added in v2.10.0

type Name string // Always "name"

func (Name) Default added in v2.10.0

func (c Name) Default() Name

func (Name) MarshalJSON added in v2.10.0

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

type NaturalLanguage added in v2.30.0

type NaturalLanguage string // Always "natural_language"

func (NaturalLanguage) Default added in v2.30.0

func (c NaturalLanguage) Default() NaturalLanguage

func (NaturalLanguage) MarshalJSON added in v2.30.0

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

type New added in v2.25.0

type New string // Always "new"

func (New) Default added in v2.25.0

func (c New) Default() New

func (New) MarshalJSON added in v2.25.0

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

type NotFound added in v2.9.0

type NotFound string // Always "not_found"

func (NotFound) Default added in v2.9.0

func (c NotFound) Default() NotFound

func (NotFound) MarshalJSON added in v2.9.0

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

type Ok added in v2.6.0

type Ok string // Always "ok"

func (Ok) Default added in v2.6.0

func (c Ok) Default() Ok

func (Ok) MarshalJSON added in v2.6.0

func (c Ok) 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 Perform added in v2.5.0

type Perform string // Always "perform"

func (Perform) Default added in v2.5.0

func (c Perform) Default() Perform

func (Perform) MarshalJSON added in v2.5.0

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

type Prebuilt added in v2.25.0

type Prebuilt string // Always "prebuilt"

func (Prebuilt) Default added in v2.25.0

func (c Prebuilt) Default() Prebuilt

func (Prebuilt) MarshalJSON added in v2.25.0

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

type Scrape added in v2.9.0

type Scrape string // Always "scrape"

func (Scrape) Default added in v2.9.0

func (c Scrape) Default() Scrape

func (Scrape) MarshalJSON added in v2.9.0

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

type Scroll added in v2.12.0

type Scroll string // Always "scroll"

func (Scroll) Default added in v2.12.0

func (c Scroll) Default() Scroll

func (Scroll) MarshalJSON added in v2.12.0

func (c Scroll) 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)

type StartURL added in v2.9.0

type StartURL string // Always "start_url"

func (StartURL) Default added in v2.9.0

func (c StartURL) Default() StartURL

func (StartURL) MarshalJSON added in v2.9.0

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

type Ticker added in v2.10.0

type Ticker string // Always "ticker"

func (Ticker) Default added in v2.10.0

func (c Ticker) Default() Ticker

func (Ticker) MarshalJSON added in v2.10.0

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

type Wait added in v2.5.0

type Wait string // Always "wait"

func (Wait) Default added in v2.5.0

func (c Wait) Default() Wait

func (Wait) MarshalJSON added in v2.5.0

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

type WaitFor added in v2.20.0

type WaitFor string // Always "waitFor"

func (WaitFor) Default added in v2.20.0

func (c WaitFor) Default() WaitFor

func (WaitFor) MarshalJSON added in v2.20.0

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

Jump to

Keyboard shortcuts

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