List returns all configured providers.
(ctx context.Context)
| 139 | |
| 140 | // List returns all configured providers. |
| 141 | func (api ProviderAPI) List(ctx context.Context) ([]Provider, error) { |
| 142 | file, err := api.listProvidersFile(ctx) |
| 143 | if err != nil { |
| 144 | return nil, err |
| 145 | } |
| 146 | out := make([]Provider, 0, len(file.Endpoints)) |
| 147 | for _, name := range file.SortedNames() { |
| 148 | out = append(out, providerFromEndpoint(name, file.Endpoints[name], api.getenv())) |
| 149 | } |
| 150 | return out, nil |
| 151 | } |
| 152 | |
| 153 | // Show returns one provider by name. |
| 154 | func (api ProviderAPI) Show(ctx context.Context, name string) (Provider, error) { |