denv

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All() []string

All 返回所有的环境变量

func Build

func Build(m map[string]string) []string

Build 创建环境变量

func Contains

func Contains(key string) bool

Contains 判断环境变量是否存在

func Get

func Get(key string, def ...string) string

Get 获取指定key的环境变量值

func GetVar added in v0.1.1

func GetVar(key string, def ...interface{}) *dvar.Var

GetVar 获取var类型的变量

func GetWithCmd added in v0.1.1

func GetWithCmd(key string, def ...interface{}) *dvar.Var

GetWithCmd 如果环境变量中没有,则去cmd中获取

func Map

func Map() map[string]string

Map 把环境变量转换成map格式

func Remove

func Remove(key ...string) error

Remove 移除环境变量,支持多个key

func Set

func Set(key string, value string) error

Set 设置环境变量

func SetMap

func SetMap(m map[string]string) error

SetMap 批量设置环境变量

Types

This section is empty.

Jump to

Keyboard shortcuts

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