4f0d95fa |
package registry // import "github.com/docker/docker/registry" |
752dd707 |
|
4352da78 |
import ( |
3a127939 |
"github.com/docker/distribution/reference" |
91e197d6 |
registrytypes "github.com/docker/docker/api/types/registry" |
4352da78 |
)
|
3ed06f96 |
// RepositoryData tracks the image list, list of endpoints for a repository |
752dd707 |
type RepositoryData struct { |
4fcb9ac4 |
// ImgList is a list of images in the repository
ImgList map[string]*ImgData
// Endpoints is a list of endpoints returned in X-Docker-Endpoints |
752dd707 |
Endpoints []string
}
|
4fcb9ac4 |
// ImgData is used to transfer image checksums to and from the registry |
752dd707 |
type ImgData struct { |
4fcb9ac4 |
// ID is an opaque string that identifies the image |
752dd707 |
ID string `json:"id"`
Checksum string `json:"checksum,omitempty"`
ChecksumPayload string `json:"-"`
Tag string `json:",omitempty"`
}
|
4fcb9ac4 |
// PingResult contains the information returned when pinging a registry. It
// indicates the registry's version and whether the registry claims to be a
// standalone registry.
type PingResult struct { |
c1be45fa |
// Version is the registry version supplied by the registry in an HTTP |
4fcb9ac4 |
// header
Version string `json:"version"`
// Standalone is set to true if the registry indicates it is a
// standalone registry in the X-Docker-Registry-Standalone
// header
Standalone bool `json:"standalone"` |
752dd707 |
} |
61c6f206 |
|
4fcb9ac4 |
// APIVersion is an integral representation of an API version (presently
// either 1 or 2) |
61c6f206 |
type APIVersion int
func (av APIVersion) String() string {
return apiVersions[av]
}
|
41e20cec |
// API Version identifiers. |
61c6f206 |
const ( |
f2d481a2 |
_ = iota
APIVersion1 APIVersion = iota |
61c6f206 |
APIVersion2
) |
568f86eb |
|
f2d481a2 |
var apiVersions = map[APIVersion]string{
APIVersion1: "v1",
APIVersion2: "v2",
}
|
4fcb9ac4 |
// RepositoryInfo describes a repository |
568f86eb |
type RepositoryInfo struct { |
3a127939 |
Name reference.Named |
4fcb9ac4 |
// Index points to registry information |
96c10098 |
Index *registrytypes.IndexInfo |
4fcb9ac4 |
// Official indicates whether the repository is considered official.
// If the registry is official, and the normalized name does not
// contain a '/' (e.g. "foo"), then it is considered an official repo.
Official bool |
a12b4661 |
// Class represents the class of the repository, such as "plugin"
// or "image".
Class string |
568f86eb |
} |