github.com/toplink-cn/moby@v0.0.0-20240305205811-460b4aebdf81/registry/types.go (about)

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