MCPcopy Index your code
hub / github.com/ddev/ddev / IsValidProvider

Method IsValidProvider

pkg/ddevapp/providers.go:13–19  ·  view source on GitHub ↗

IsValidProvider is a helper function to determine if a provider value is valid, returning true if the supplied provider is valid and false otherwise.

(provider string)

Source from the content-addressed store, hash-verified

11// IsValidProvider is a helper function to determine if a provider value is valid, returning
12// true if the supplied provider is valid and false otherwise.
13func (app *DdevApp) IsValidProvider(provider string) (bool, error) {
14 pList, err := app.GetValidProviders()
15 if err != nil {
16 return false, err
17 }
18 return nodeps.ArrayContainsString(pList, provider), nil
19}
20
21// GetValidProviders is a helper function that returns a list of valid providers.
22func (app *DdevApp) GetValidProviders() ([]string, error) {

Callers

nothing calls this directly

Calls 2

GetValidProvidersMethod · 0.95
ArrayContainsStringFunction · 0.92

Tested by

no test coverage detected