types.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package registry // import "github.com/docker/docker/registry"
  2. import (
  3. "github.com/distribution/reference"
  4. "github.com/docker/docker/api/types/registry"
  5. )
  6. // APIVersion is an integral representation of an API version (presently
  7. // either 1 or 2)
  8. //
  9. // Deprecated: v1 registries are deprecated, and endpoints are always v2.
  10. type APIVersion int
  11. func (av APIVersion) String() string {
  12. return apiVersions[av]
  13. }
  14. // API Version identifiers.
  15. const (
  16. APIVersion1 APIVersion = 1 // Deprecated: v1 registries are deprecated, and endpoints are always v2.
  17. APIVersion2 APIVersion = 2 // Deprecated: v1 registries are deprecated, and endpoints are always v2.
  18. )
  19. var apiVersions = map[APIVersion]string{
  20. APIVersion1: "v1",
  21. APIVersion2: "v2",
  22. }
  23. // RepositoryInfo describes a repository
  24. type RepositoryInfo struct {
  25. Name reference.Named
  26. // Index points to registry information
  27. Index *registry.IndexInfo
  28. // Official indicates whether the repository is considered official.
  29. // If the registry is official, and the normalized name does not
  30. // contain a '/' (e.g. "foo"), then it is considered an official repo.
  31. Official bool
  32. // Class represents the class of the repository, such as "plugin"
  33. // or "image".
  34. Class string
  35. }