constant

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 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 Cron added in v0.1.0

type Cron string // Always "cron"

func (Cron) Default added in v0.1.0

func (c Cron) Default() Cron

func (Cron) MarshalJSON added in v0.1.0

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

type Delayed added in v0.1.0

type Delayed string // Always "delayed"

func (Delayed) Default added in v0.1.0

func (c Delayed) Default() Delayed

func (Delayed) MarshalJSON added in v0.1.0

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

type Interval added in v0.1.0

type Interval string // Always "interval"

func (Interval) Default added in v0.1.0

func (c Interval) Default() Interval

func (Interval) MarshalJSON added in v0.1.0

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

type Scheduled added in v0.1.0

type Scheduled string // Always "scheduled"

func (Scheduled) Default added in v0.1.0

func (c Scheduled) Default() Scheduled

func (Scheduled) MarshalJSON added in v0.1.0

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

Jump to

Keyboard shortcuts

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