github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/registry/types.go (about)

     1  package registry // import "github.com/Prakhar-Agarwal-byte/moby/registry"
     2  
     3  import (
     4  	"github.com/Prakhar-Agarwal-byte/moby/api/types/registry"
     5  	"github.com/distribution/reference"
     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  }