mirror of
https://github.com/shirou/gopsutil.git
synced 2025-05-02 22:17:08 +08:00
add more env keys
This commit is contained in:
parent
177e1b1982
commit
35657e3262
@ -6,7 +6,7 @@ type EnvKeyType string
|
|||||||
// gopsutil relies on to perform calls against the OS.
|
// gopsutil relies on to perform calls against the OS.
|
||||||
// Example of use:
|
// Example of use:
|
||||||
//
|
//
|
||||||
// ctx := context.WithValue(context.Background(), common.EnvKey, EnvMap{"HOST_PROC": "/myproc"})
|
// ctx := context.WithValue(context.Background(), common.EnvKey, EnvMap{common.HostProcEnvKey: "/myproc"})
|
||||||
// avg, err := load.AvgWithContext(ctx)
|
// avg, err := load.AvgWithContext(ctx)
|
||||||
var EnvKey = EnvKeyType("env")
|
var EnvKey = EnvKeyType("env")
|
||||||
|
|
||||||
@ -14,6 +14,10 @@ const (
|
|||||||
HostProcEnvKey EnvKeyType = "HOST_PROC"
|
HostProcEnvKey EnvKeyType = "HOST_PROC"
|
||||||
HostSysEnvKey EnvKeyType = "HOST_SYS"
|
HostSysEnvKey EnvKeyType = "HOST_SYS"
|
||||||
HostEtcEnvKey EnvKeyType = "HOST_ETC"
|
HostEtcEnvKey EnvKeyType = "HOST_ETC"
|
||||||
|
HostVarEnvKey EnvKeyType = "HOST_VAR"
|
||||||
|
HostRunEnvKey EnvKeyType = "HOST_RUN"
|
||||||
|
HostDevEnvKey EnvKeyType = "HOST_DEV"
|
||||||
|
HostRootEnvKey EnvKeyType = "HOST_ROOT"
|
||||||
)
|
)
|
||||||
|
|
||||||
type EnvMap map[EnvKeyType]string
|
type EnvMap map[EnvKeyType]string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user