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