Documentation
¶
Index ¶
Constants ¶
const (
// DefaultAPIEndpoint is the default endpoint of the ImageSpy API.
DefaultAPIEndpoint = "https://imagespy.hydrantosaurus.com"
)
Variables ¶
var DefaultRegistryWhitelist = map[string]struct{}{
"index.docker.io": struct{}{},
"docker.io": struct{}{},
"quay.io": struct{}{},
}
Functions ¶
This section is empty.
Types ¶
type ClientV1 ¶
type ClientV1 struct {
ImageSpy *ImageSpyService
Layer *LayerService
// contains filtered or unexported fields
}
ClientV1 is the client for the Image Spy API version 1.
func NewClientV1 ¶
func NewClientV1() *ClientV1
NewClientV1 returns a new client for the V1 HTTP API.
func (*ClientV1) WithBaseURL ¶
WithBaseURL sets the base URL of the ImageSpy API.
func (*ClientV1) WithHTTPClient ¶
WithHTTPClient sets the http.Client.
func (*ClientV1) WithRegistryWhitelist ¶
WithRegistryWhitelist allows specifying the registries to send requests to.
func (*ClientV1) WithTimeout ¶
WithTimeout sets the timeout of the underlying http.Client.
type ClientV2 ¶ added in v0.3.0
type ClientV2 struct {
Image *ImageServiceV2
Layer *LayerServiceV2
// contains filtered or unexported fields
}
func NewClientV2 ¶ added in v0.3.0
func NewClientV2() *ClientV2
NewClientV2 returns a new client for the V2 HTTP API.
func (*ClientV2) WithBaseURL ¶ added in v0.3.0
WithBaseURL sets the base URL of the ImageSpy API.
func (*ClientV2) WithHTTPClient ¶ added in v0.3.0
WithHTTPClient sets the http.Client.
func (*ClientV2) WithTimeout ¶ added in v0.3.0
WithTimeout sets the timeout of the underlying http.Client.
type Image ¶
type Image struct {
Created time.Time `json:"created"`
Digest string `json:"digest"`
Name string `json:"name"`
Tag string `json:"tag"`
}
Image is a Docker image.
type ImageServiceV2 ¶ added in v0.3.0
type ImageServiceV2 struct {
// contains filtered or unexported fields
}
ImageServiceV2 exposes the /v2/images API.
type ImageSpy ¶
type ImageSpy struct {
CurrentImage *Image `json:"current_image"`
LatestImage *Image `json:"latest_image"`
Name string `json:"name"`
}
ImageSpy is a ImageSpy.
type ImageSpyError ¶ added in v0.2.1
type ImageSpyError struct {
// contains filtered or unexported fields
}
ImageSpyError is the base error for all errors specific to this package.
func (*ImageSpyError) Error ¶ added in v0.2.1
func (e *ImageSpyError) Error() string
type ImageSpyService ¶
type ImageSpyService struct {
// contains filtered or unexported fields
}
ImageSpyService handles interactions.
type ImageV2 ¶ added in v0.3.0
type ImageV2 struct {
Digest string `json:"digest"`
LatestImage *LatestImageV2 `json:"latest_image"`
Name string `json:"name"`
Tags []string `json:"tags"`
}
ImageV2 is an Image of the V2 API.
type LatestImageV2 ¶ added in v0.3.0
type LatestImageV2 struct {
Digest string `json:"digest"`
Name string `json:"name"`
Tags []string `json:"tags"`
}
LatestImageV2 is the latest image of an image.
type Layer ¶ added in v0.2.0
Layer is the digest of a layer and a list of images which created the layer.
type LayerService ¶ added in v0.2.0
type LayerService struct {
// contains filtered or unexported fields
}
LayerService exposes the Layer API of the Image Spy API.
type LayerServiceV2 ¶ added in v0.3.0
type LayerServiceV2 struct {
// contains filtered or unexported fields
}
LayerServiceV2 exposes the /v2/images API.
type LayerV2 ¶ added in v0.3.0
type LayerV2 struct {
Digest string `json:"digest"`
SourceImages []*ImageV2 `json:"source_images"`
}
LayerV2 is a Layer of the V2 API.
type Logger ¶
type Logger interface {
Debug(args ...interface{})
}
Logger provides logging.
var Log Logger = &NullLogger{}
Log is used by this library to log messages.
type NotFoundError ¶ added in v0.2.1
type NotFoundError struct {
ImageSpyError
// contains filtered or unexported fields
}
NotFoundError indicates that a resource could not be found.