mirror of
https://github.com/genuinetools/reg.git
synced 2024-06-30 11:04:16 -04:00
19 lines
431 B
Go
19 lines
431 B
Go
|
package registry
|
||
|
|
||
|
type tagsResponse struct {
|
||
|
Tags []string `json:"tags"`
|
||
|
}
|
||
|
|
||
|
// Tags returns the tags for a specific repository.
|
||
|
func (r *Registry) Tags(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(url, &response); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
return response.Tags, nil
|
||
|
}
|