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

Method GetValidProviders

pkg/ddevapp/providers.go:22–39  ·  view source on GitHub ↗

GetValidProviders is a helper function that returns a list of valid providers.

()

Source from the content-addressed store, hash-verified

20
21// GetValidProviders is a helper function that returns a list of valid providers.
22func (app *DdevApp) GetValidProviders() ([]string, error) {
23 pPath := app.GetConfigPath("providers")
24 providers := []string{}
25 if !fileutil.IsDirectory(pPath) {
26 return providers, nil
27 }
28
29 dirEntrySlice, err := os.ReadDir(pPath)
30 if err != nil {
31 return providers, err
32 }
33 for _, de := range dirEntrySlice {
34 if before, ok := strings.CutSuffix(de.Name(), ".yaml"); ok {
35 providers = append(providers, before)
36 }
37 }
38 return providers, nil
39}

Callers 3

IsValidProviderMethod · 0.95
initFunction · 0.95
initFunction · 0.95

Calls 2

GetConfigPathMethod · 0.95
IsDirectoryFunction · 0.92

Tested by

no test coverage detected