environs

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

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

func Exist added in v0.3.12

func Exist(name string) bool

func Float32

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

func Float64

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

func Int64

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

func Lookup added in v0.3.12

func Lookup(name string) (string, bool)

func SetPolicy added in v0.3.12

func SetPolicy(m Mode)

func String

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

Types

type Mode added in v0.3.12

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

func GetPolicy added in v0.3.12

func GetPolicy() Mode

type Option added in v0.3.12

type Option func(*option)

func WithBool added in v0.3.12

func WithBool(v bool) Option

func WithFloat32 added in v0.3.12

func WithFloat32(v float32) Option

func WithFloat64 added in v0.3.12

func WithFloat64(v float64) Option

func WithInt64 added in v0.3.12

func WithInt64(v int64) Option

func WithString added in v0.3.12

func WithString(v string) Option

Jump to

Keyboard shortcuts

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