(ctx context.Context)
| 38 | } |
| 39 | |
| 40 | func (c Client) FetchRegistry(ctx context.Context) (Registry, error) { |
| 41 | registryURL := strings.TrimSpace(c.RegistryURL) |
| 42 | if registryURL == "" { |
| 43 | registryURL = DefaultRegistryURL |
| 44 | } |
| 45 | data, errDownload := c.get(ctx, registryURL, "application/json", RequestKindRegistry, 0) |
| 46 | if errDownload != nil { |
| 47 | return Registry{}, errDownload |
| 48 | } |
| 49 | registry, errParse := ParseRegistry(data) |
| 50 | if errParse != nil { |
| 51 | return Registry{}, errParse |
| 52 | } |
| 53 | return registry, nil |
| 54 | } |
| 55 | |
| 56 | // FetchLatestRelease returns the latest published release of the plugin's |
| 57 | // GitHub repository, mirroring the WebUI panel update check. |
no test coverage detected