MCPcopy
hub / github.com/henrygd/beszel / GetEnv

Function GetEnv

agent/utils/utils.go:15–20  ·  view source on GitHub ↗

GetEnv retrieves an environment variable with a "BESZEL_AGENT_" prefix, or falls back to the unprefixed key.

(key string)

Source from the content-addressed store, hash-verified

13
14// GetEnv retrieves an environment variable with a "BESZEL_AGENT_" prefix, or falls back to the unprefixed key.
15func GetEnv(key string) (value string, exists bool) {
16 if value, exists = os.LookupEnv("BESZEL_AGENT_" + key); exists {
17 return value, exists
18 }
19 return os.LookupEnv(key)
20}
21
22// BytesToMegabytes converts bytes to megabytes and rounds to two decimal places.
23func BytesToMegabytes(b float64) float64 {

Callers 15

loadPublicKeysMethod · 0.92
NewGPUManagerFunction · 0.92
StartServerMethod · 0.92
GetAddressFunction · 0.92
GetNetworkFunction · 0.92
initializeDiskInfoMethod · 0.92
GetDataDirFunction · 0.92
collectIntelStatsMethod · 0.92
ScanDevicesMethod · 0.92

Calls

no outgoing calls

Tested by 1

TestGetEnvFunction · 0.56