environ

package
v0.3.15 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindEnv

func BindEnv(in interface{}) error

func Bool

func Bool(name string, opts ...Option) bool

func Exist

func Exist(name string) bool

func Float32

func Float32(name string, opts ...Option) float32

func Float64

func Float64(name string, opts ...Option) float64

func Getenv

func Getenv(name string) (string, bool)

func Int64

func Int64(name string, opts ...Option) int64

func SetPolicy

func SetPolicy(m Mode)

func String

func String(name string, opts ...Option) string

Types

type Mode

type Mode int
const (
	PreLoad    Mode = iota // 性能优先, 预加载模式, 后续设置的环境变量不能获取到
	AlwaysLoad Mode = iota
)

func GetPolicy

func GetPolicy() Mode

type Option

type Option func(*option)

func Required

func Required() Option

the env is required and must be set

func WithBool

func WithBool(v bool) Option

func WithFloat32

func WithFloat32(v float32) Option

func WithFloat64

func WithFloat64(v float64) Option

func WithInt64

func WithInt64(v int64) Option

func WithString

func WithString(v string) Option

Jump to

Keyboard shortcuts

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