summaryrefslogtreecommitdiff
path: root/vendor/github.com/shirou/gopsutil/v4/common/env.go
blob: 47e471c402f7e48d43e3279d4748065e564e9e07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// SPDX-License-Identifier: BSD-3-Clause
package common

type EnvKeyType string

// EnvKey is a context key that can be used to set programmatically the environment
// gopsutil relies on to perform calls against the OS.
// Example of use:
//
//	ctx := context.WithValue(context.Background(), common.EnvKey, EnvMap{common.HostProcEnvKey: "/myproc"})
//	avg, err := load.AvgWithContext(ctx)
var EnvKey = EnvKeyType("env")

const (
	HostProcEnvKey    EnvKeyType = "HOST_PROC"
	HostSysEnvKey     EnvKeyType = "HOST_SYS"
	HostEtcEnvKey     EnvKeyType = "HOST_ETC"
	HostVarEnvKey     EnvKeyType = "HOST_VAR"
	HostRunEnvKey     EnvKeyType = "HOST_RUN"
	HostDevEnvKey     EnvKeyType = "HOST_DEV"
	HostRootEnvKey    EnvKeyType = "HOST_ROOT"
	HostProcMountinfo EnvKeyType = "HOST_PROC_MOUNTINFO"
)

type EnvMap map[EnvKeyType]string