28 lines
414 B
Go
28 lines
414 B
Go
package client
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"coopcloud.tech/abra/web"
|
|
)
|
|
|
|
type Tag struct {
|
|
Layer string
|
|
Name string
|
|
}
|
|
|
|
type Tags []Tag
|
|
|
|
var registryURL = "https://registry.hub.docker.com/v1/repositories/%s/tags"
|
|
|
|
func GetRegistryTags(image string) (Tags, error) {
|
|
var tags Tags
|
|
|
|
tagsUrl := fmt.Sprintf(registryURL, image)
|
|
if err := web.ReadJSON(tagsUrl, &tags); err != nil {
|
|
return tags, err
|
|
}
|
|
|
|
return tags, nil
|
|
}
|