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