MCPcopy Create free account
hub / github.com/ddev/ddev / ValidPerformanceModeOptions

Function ValidPerformanceModeOptions

pkg/config/types/performance_mode.go:20–36  ·  view source on GitHub ↗

ValidPerformanceModeOptions returns a slice of valid performance mode options for the project config or global config if global is true.

(configType ConfigType)

Source from the content-addressed store, hash-verified

18// ValidPerformanceModeOptions returns a slice of valid performance mode
19// options for the project config or global config if global is true.
20func ValidPerformanceModeOptions(configType ConfigType) []PerformanceMode {
21 switch configType {
22 case ConfigTypeGlobal:
23 return []PerformanceMode{
24 PerformanceModeNone,
25 PerformanceModeMutagen,
26 }
27 case ConfigTypeProject:
28 return []PerformanceMode{
29 PerformanceModeGlobal,
30 PerformanceModeNone,
31 PerformanceModeMutagen,
32 }
33 default:
34 panic(fmt.Errorf("invalid ConfigType: %v", configType))
35 }
36}
37
38// IsValidPerformanceMode checks to see if the given performance mode
39// option is valid.

Callers 6

initFunction · 0.92
IsValidPerformanceModeFunction · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by 2