2018-02-05 21:05:59 +00:00
|
|
|
package registry // import "github.com/docker/docker/registry"
|
2014-08-07 14:43:06 +00:00
|
|
|
|
2015-11-18 22:20:54 +00:00
|
|
|
import (
|
2017-01-26 00:54:18 +00:00
|
|
|
"github.com/docker/distribution/reference"
|
2022-02-26 18:13:43 +00:00
|
|
|
"github.com/docker/docker/api/types/registry"
|
2015-11-18 22:20:54 +00:00
|
|
|
)
|
|
|
|
|
2015-07-21 19:40:36 +00:00
|
|
|
// APIVersion is an integral representation of an API version (presently
|
|
|
|
// either 1 or 2)
|
2014-08-26 23:21:04 +00:00
|
|
|
type APIVersion int
|
|
|
|
|
|
|
|
func (av APIVersion) String() string {
|
|
|
|
return apiVersions[av]
|
|
|
|
}
|
|
|
|
|
2014-12-12 01:55:15 +00:00
|
|
|
// API Version identifiers.
|
2014-08-26 23:21:04 +00:00
|
|
|
const (
|
2021-10-05 19:14:17 +00:00
|
|
|
APIVersion1 APIVersion = 1
|
|
|
|
APIVersion2 APIVersion = 2
|
2014-08-26 23:21:04 +00:00
|
|
|
)
|
2014-10-07 01:54:52 +00:00
|
|
|
|
2016-03-01 07:07:41 +00:00
|
|
|
var apiVersions = map[APIVersion]string{
|
|
|
|
APIVersion1: "v1",
|
|
|
|
APIVersion2: "v2",
|
|
|
|
}
|
|
|
|
|
2015-07-21 19:40:36 +00:00
|
|
|
// RepositoryInfo describes a repository
|
2014-10-07 01:54:52 +00:00
|
|
|
type RepositoryInfo struct {
|
2017-01-26 00:54:18 +00:00
|
|
|
Name reference.Named
|
2015-07-21 19:40:36 +00:00
|
|
|
// Index points to registry information
|
2022-02-26 18:13:43 +00:00
|
|
|
Index *registry.IndexInfo
|
2015-07-21 19:40:36 +00:00
|
|
|
// 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
|
2016-11-15 23:06:48 +00:00
|
|
|
// Class represents the class of the repository, such as "plugin"
|
|
|
|
// or "image".
|
|
|
|
Class string
|
2014-10-07 01:54:52 +00:00
|
|
|
}
|