2014-08-07 10:43:06 -04:00
|
|
|
package registry
|
|
|
|
|
|
|
|
type SearchResult struct {
|
|
|
|
StarCount int `json:"star_count"`
|
|
|
|
IsOfficial bool `json:"is_official"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
IsTrusted bool `json:"is_trusted"`
|
2015-04-03 13:29:30 -04:00
|
|
|
IsAutomated bool `json:"is_automated"`
|
2014-08-07 10:43:06 -04:00
|
|
|
Description string `json:"description"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SearchResults struct {
|
|
|
|
Query string `json:"query"`
|
|
|
|
NumResults int `json:"num_results"`
|
|
|
|
Results []SearchResult `json:"results"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type RepositoryData struct {
|
|
|
|
ImgList map[string]*ImgData
|
|
|
|
Endpoints []string
|
|
|
|
Tokens []string
|
|
|
|
}
|
|
|
|
|
|
|
|
type ImgData struct {
|
|
|
|
ID string `json:"id"`
|
|
|
|
Checksum string `json:"checksum,omitempty"`
|
|
|
|
ChecksumPayload string `json:"-"`
|
|
|
|
Tag string `json:",omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type RegistryInfo struct {
|
|
|
|
Version string `json:"version"`
|
|
|
|
Standalone bool `json:"standalone"`
|
|
|
|
}
|
2014-08-26 19:21:04 -04:00
|
|
|
|
2014-10-09 20:34:34 -04:00
|
|
|
type FSLayer struct {
|
|
|
|
BlobSum string `json:"blobSum"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ManifestHistory struct {
|
|
|
|
V1Compatibility string `json:"v1Compatibility"`
|
|
|
|
}
|
|
|
|
|
2014-10-01 21:26:06 -04:00
|
|
|
type ManifestData struct {
|
2014-10-09 20:34:34 -04:00
|
|
|
Name string `json:"name"`
|
|
|
|
Tag string `json:"tag"`
|
|
|
|
Architecture string `json:"architecture"`
|
|
|
|
FSLayers []*FSLayer `json:"fsLayers"`
|
|
|
|
History []*ManifestHistory `json:"history"`
|
|
|
|
SchemaVersion int `json:"schemaVersion"`
|
2014-10-01 21:26:06 -04:00
|
|
|
}
|
|
|
|
|
2014-08-26 19:21:04 -04:00
|
|
|
type APIVersion int
|
|
|
|
|
|
|
|
func (av APIVersion) String() string {
|
|
|
|
return apiVersions[av]
|
|
|
|
}
|
|
|
|
|
|
|
|
var apiVersions = map[APIVersion]string{
|
|
|
|
1: "v1",
|
|
|
|
2: "v2",
|
|
|
|
}
|
|
|
|
|
2014-12-11 20:55:15 -05:00
|
|
|
// API Version identifiers.
|
2014-08-26 19:21:04 -04:00
|
|
|
const (
|
2014-12-11 20:55:15 -05:00
|
|
|
APIVersionUnknown = iota
|
|
|
|
APIVersion1
|
2014-08-26 19:21:04 -04:00
|
|
|
APIVersion2
|
|
|
|
)
|
2014-10-06 21:54:52 -04:00
|
|
|
|
|
|
|
// RepositoryInfo Examples:
|
|
|
|
// {
|
|
|
|
// "Index" : {
|
|
|
|
// "Name" : "docker.io",
|
|
|
|
// "Mirrors" : ["https://registry-2.docker.io/v1/", "https://registry-3.docker.io/v1/"],
|
|
|
|
// "Secure" : true,
|
|
|
|
// "Official" : true,
|
|
|
|
// },
|
|
|
|
// "RemoteName" : "library/debian",
|
|
|
|
// "LocalName" : "debian",
|
|
|
|
// "CanonicalName" : "docker.io/debian"
|
|
|
|
// "Official" : true,
|
|
|
|
// }
|
|
|
|
|
|
|
|
// {
|
|
|
|
// "Index" : {
|
|
|
|
// "Name" : "127.0.0.1:5000",
|
|
|
|
// "Mirrors" : [],
|
|
|
|
// "Secure" : false,
|
|
|
|
// "Official" : false,
|
|
|
|
// },
|
|
|
|
// "RemoteName" : "user/repo",
|
|
|
|
// "LocalName" : "127.0.0.1:5000/user/repo",
|
|
|
|
// "CanonicalName" : "127.0.0.1:5000/user/repo",
|
|
|
|
// "Official" : false,
|
|
|
|
// }
|
|
|
|
type IndexInfo struct {
|
|
|
|
Name string
|
|
|
|
Mirrors []string
|
|
|
|
Secure bool
|
|
|
|
Official bool
|
|
|
|
}
|
|
|
|
|
|
|
|
type RepositoryInfo struct {
|
|
|
|
Index *IndexInfo
|
|
|
|
RemoteName string
|
|
|
|
LocalName string
|
|
|
|
CanonicalName string
|
|
|
|
Official bool
|
|
|
|
}
|