abra/client/registry.go

28 lines
414 B
Go
Raw Normal View History

2021-08-06 13:40:23 +00:00
package client
import (
"fmt"
"coopcloud.tech/abra/web"
2021-08-06 13:40:23 +00:00
)
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
2021-08-06 13:40:23 +00:00
}