try

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config[T comparable](key string) func() T

TODO(ezekg) implement relay toml/yaml config file?

func Env

func Env(key string) func() string

func EnvAs

func EnvAs[T any](key string, converter func(string) T) func() T

func EnvBool

func EnvBool(key string) func() bool

func EnvDuration

func EnvDuration(key string) func() time.Duration

func EnvInt

func EnvInt(key string) func() int

func Try

func Try[T comparable](accessors ...Accessor[T]) T

Types

type Accessor

type Accessor[T comparable] func() T

func Static

func Static[T comparable](value T) Accessor[T]

Jump to

Keyboard shortcuts

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