constant

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 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 Browserbase added in v0.10.0

type Browserbase string // Always "browserbase"

func (Browserbase) Default added in v0.10.0

func (c Browserbase) Default() Browserbase

func (Browserbase) MarshalJSON added in v0.10.0

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

type Constant

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

type External added in v0.10.0

type External string // Always "external"

func (External) Default added in v0.10.0

func (c External) Default() External

func (External) MarshalJSON added in v0.10.0

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

type Running added in v0.13.0

type Running string // Always "running"

func (Running) Default added in v0.13.0

func (c Running) Default() Running

func (Running) MarshalJSON added in v0.13.0

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

Jump to

Keyboard shortcuts

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