AddProvider inserts a provider.
(ctx context.Context, name string, endpoint providers.Endpoint)
| 126 | |
| 127 | // AddProvider inserts a provider. |
| 128 | func (s Store) AddProvider(ctx context.Context, name string, endpoint providers.Endpoint) error { |
| 129 | file, err := s.ListProviders(ctx) |
| 130 | if err != nil { |
| 131 | return err |
| 132 | } |
| 133 | if err := providers.Add(&file, name, endpoint); err != nil { |
| 134 | return err |
| 135 | } |
| 136 | return s.upsertProvider(ctx, name, file.Endpoints[name]) |
| 137 | } |
| 138 | |
| 139 | // UpdateProvider applies a sparse patch. |
| 140 | func (s Store) UpdateProvider(ctx context.Context, name string, patch ProviderPatch) error { |