types.go 1006 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package registry // import "github.com/docker/docker/registry"
  2. import (
  3. "github.com/docker/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. type APIVersion int
  9. func (av APIVersion) String() string {
  10. return apiVersions[av]
  11. }
  12. // API Version identifiers.
  13. const (
  14. APIVersion1 APIVersion = 1
  15. APIVersion2 APIVersion = 2
  16. )
  17. var apiVersions = map[APIVersion]string{
  18. APIVersion1: "v1",
  19. APIVersion2: "v2",
  20. }
  21. // RepositoryInfo describes a repository
  22. type RepositoryInfo struct {
  23. Name reference.Named
  24. // Index points to registry information
  25. Index *registry.IndexInfo
  26. // Official indicates whether the repository is considered official.
  27. // If the registry is official, and the normalized name does not
  28. // contain a '/' (e.g. "foo"), then it is considered an official repo.
  29. Official bool
  30. // Class represents the class of the repository, such as "plugin"
  31. // or "image".
  32. Class string
  33. }