mirror of
https://github.com/genuinetools/reg.git
synced 2024-05-10 00:38:31 -04:00
32589e90be
* passing context in layer calls * more contexting * clair folder and context in handlers * fixed token transport to reuse request context * tests * taking out context pass in server handlers
21 lines
478 B
Go
21 lines
478 B
Go
package registry
|
|
|
|
import "context"
|
|
|
|
type tagsResponse struct {
|
|
Tags []string `json:"tags"`
|
|
}
|
|
|
|
// Tags returns the tags for a specific repository.
|
|
func (r *Registry) Tags(ctx context.Context, repository string) ([]string, error) {
|
|
url := r.url("/v2/%s/tags/list", repository)
|
|
r.Logf("registry.tags url=%s repository=%s", url, repository)
|
|
|
|
var response tagsResponse
|
|
if _, err := r.getJSON(ctx, url, &response); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return response.Tags, nil
|
|
}
|