mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
286992ef53
These are only used internally, and the v1Endpoint.Path() function was only used to get the `_ping` URL, so let's inline that code instead. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
39 lines
1 KiB
Go
39 lines
1 KiB
Go
package registry // import "github.com/docker/docker/registry"
|
|
|
|
import (
|
|
"github.com/docker/distribution/reference"
|
|
registrytypes "github.com/docker/docker/api/types/registry"
|
|
)
|
|
|
|
// APIVersion is an integral representation of an API version (presently
|
|
// either 1 or 2)
|
|
type APIVersion int
|
|
|
|
func (av APIVersion) String() string {
|
|
return apiVersions[av]
|
|
}
|
|
|
|
// API Version identifiers.
|
|
const (
|
|
APIVersion1 APIVersion = 1
|
|
APIVersion2 APIVersion = 2
|
|
)
|
|
|
|
var apiVersions = map[APIVersion]string{
|
|
APIVersion1: "v1",
|
|
APIVersion2: "v2",
|
|
}
|
|
|
|
// RepositoryInfo describes a repository
|
|
type RepositoryInfo struct {
|
|
Name reference.Named
|
|
// Index points to registry information
|
|
Index *registrytypes.IndexInfo
|
|
// 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
|
|
// Class represents the class of the repository, such as "plugin"
|
|
// or "image".
|
|
Class string
|
|
}
|