-
-
Notifications
You must be signed in to change notification settings - Fork 588
/
values.go
48 lines (37 loc) · 1.3 KB
/
values.go
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package globalconfig
import (
"os"
"github.com/ddev/ddev/pkg/nodeps"
)
// Container types used with DDEV (duplicated from ddevapp, avoiding cross-package cycles)
const (
DdevSSHAgentContainer = "ddev-ssh-agent"
DdevRouterContainer = "ddev-router"
XdebugIDELocationContainer = "container"
XdebugIDELocationWSL2 = "wsl2"
)
const DdevGithubOrg = "ddev"
// ValidOmitContainers is the valid omit's that can be done in for a project
var ValidOmitContainers = map[string]bool{
DdevRouterContainer: true,
DdevSSHAgentContainer: true,
}
// DdevNoInstrumentation is set to true if the env var is set
var DdevNoInstrumentation = os.Getenv("DDEV_NO_INSTRUMENTATION") == "true"
// DdevDebug is set to true if the env var is set
var DdevDebug = (os.Getenv("DDEV_DEBUG") == "true")
// DdevVerbose is set to true if the env var is set
var DdevVerbose = (os.Getenv("DDEV_VERBOSE") == "true")
var ValidXdebugIDELocations = []string{XdebugIDELocationContainer, XdebugIDELocationWSL2, ""}
// GoroutineCount for tests
var GoroutineCount = 0
// IsValidXdebugIDELocation limits the choices for XdebugIDELocation
func IsValidXdebugIDELocation(loc string) bool {
switch {
case nodeps.ArrayContainsString(ValidXdebugIDELocations, loc):
return true
case nodeps.IsIPAddress(loc):
return true
}
return false
}