gopkg.in/docker/docker.v23@v23.0.11/registry/types.go (about)

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