env

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package env

Package env

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key string) string

GetEnv 获取环境变量

func GetEnvs

func GetEnvs(keys ...string) []string

GetEnvs 获取多个环境变量

func IsEnvEqual

func IsEnvEqual(env, dst string) bool

IsEnvEqual 比较环境变量

func SetEnvContext

func SetEnvContext(c context.Context, key, val string) context.Context

SetEnvContext 设置上下文环境变量

Types

type EnvLoader added in v1.0.4

type EnvLoader struct {
	KeepRawValue bool // 断言失败时返回原始值 为false时raw永远为原始值的空值
	// contains filtered or unexported fields
}

func (*EnvLoader) Bool added in v1.0.4

func (e *EnvLoader) Bool() bool

func (*EnvLoader) Float32 added in v1.0.4

func (e *EnvLoader) Float32() float32

func (*EnvLoader) Float64 added in v1.0.4

func (e *EnvLoader) Float64() float64

func (*EnvLoader) Get added in v1.0.4

func (e *EnvLoader) Get(key string) *EnvLoader

Get 加载环境变量

func (*EnvLoader) GetValue added in v1.0.4

func (e *EnvLoader) GetValue(key string) string

func (*EnvLoader) Int added in v1.0.4

func (e *EnvLoader) Int() int

func (*EnvLoader) Int16 added in v1.0.4

func (e *EnvLoader) Int16() int16

func (*EnvLoader) Int32 added in v1.0.4

func (e *EnvLoader) Int32() int32

func (*EnvLoader) Int64 added in v1.0.4

func (e *EnvLoader) Int64() int64

func (*EnvLoader) Int8 added in v1.0.4

func (e *EnvLoader) Int8() int8

func (*EnvLoader) Interface added in v1.0.4

func (e *EnvLoader) Interface() interface{}

func (*EnvLoader) MustBool added in v1.0.7

func (e *EnvLoader) MustBool(def bool) bool

func (*EnvLoader) MustFloat32 added in v1.0.7

func (e *EnvLoader) MustFloat32(def float32) float32

func (*EnvLoader) MustFloat64 added in v1.0.7

func (e *EnvLoader) MustFloat64(def float64) float64

func (*EnvLoader) MustInt added in v1.0.7

func (e *EnvLoader) MustInt(def int) int

func (*EnvLoader) MustInt16 added in v1.0.7

func (e *EnvLoader) MustInt16(def int16) int16

func (*EnvLoader) MustInt32 added in v1.0.7

func (e *EnvLoader) MustInt32(def int32) int32

func (*EnvLoader) MustInt64 added in v1.0.7

func (e *EnvLoader) MustInt64(def int64) int64

func (*EnvLoader) MustInt8 added in v1.0.7

func (e *EnvLoader) MustInt8(def int8) int8

func (*EnvLoader) Raw added in v1.0.4

func (e *EnvLoader) Raw() string

Raw 返回原始值

func (*EnvLoader) Time added in v1.0.4

func (e *EnvLoader) Time() time.Time

Time 转换时间戳

Jump to

Keyboard shortcuts

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