github.com/christopherobin/docker@v1.6.2/registry/types.go (about)

     1  package registry
     2  
     3  type SearchResult struct {
     4  	StarCount   int    `json:"star_count"`
     5  	IsOfficial  bool   `json:"is_official"`
     6  	Name        string `json:"name"`
     7  	IsTrusted   bool   `json:"is_trusted"`
     8  	Description string `json:"description"`
     9  }
    10  
    11  type SearchResults struct {
    12  	Query      string         `json:"query"`
    13  	NumResults int            `json:"num_results"`
    14  	Results    []SearchResult `json:"results"`
    15  }
    16  
    17  type RepositoryData struct {
    18  	ImgList   map[string]*ImgData
    19  	Endpoints []string
    20  	Tokens    []string
    21  }
    22  
    23  type ImgData struct {
    24  	ID              string `json:"id"`
    25  	Checksum        string `json:"checksum,omitempty"`
    26  	ChecksumPayload string `json:"-"`
    27  	Tag             string `json:",omitempty"`
    28  }
    29  
    30  type RegistryInfo struct {
    31  	Version    string `json:"version"`
    32  	Standalone bool   `json:"standalone"`
    33  }
    34  
    35  type FSLayer struct {
    36  	BlobSum string `json:"blobSum"`
    37  }
    38  
    39  type ManifestHistory struct {
    40  	V1Compatibility string `json:"v1Compatibility"`
    41  }
    42  
    43  type ManifestData struct {
    44  	Name          string             `json:"name"`
    45  	Tag           string             `json:"tag"`
    46  	Architecture  string             `json:"architecture"`
    47  	FSLayers      []*FSLayer         `json:"fsLayers"`
    48  	History       []*ManifestHistory `json:"history"`
    49  	SchemaVersion int                `json:"schemaVersion"`
    50  }
    51  
    52  type APIVersion int
    53  
    54  func (av APIVersion) String() string {
    55  	return apiVersions[av]
    56  }
    57  
    58  var apiVersions = map[APIVersion]string{
    59  	1: "v1",
    60  	2: "v2",
    61  }
    62  
    63  // API Version identifiers.
    64  const (
    65  	APIVersionUnknown = iota
    66  	APIVersion1
    67  	APIVersion2
    68  )
    69  
    70  // RepositoryInfo Examples:
    71  // {
    72  //   "Index" : {
    73  //     "Name" : "docker.io",
    74  //     "Mirrors" : ["https://registry-2.docker.io/v1/", "https://registry-3.docker.io/v1/"],
    75  //     "Secure" : true,
    76  //     "Official" : true,
    77  //   },
    78  //   "RemoteName" : "library/debian",
    79  //   "LocalName" : "debian",
    80  //   "CanonicalName" : "docker.io/debian"
    81  //   "Official" : true,
    82  // }
    83  
    84  // {
    85  //   "Index" : {
    86  //     "Name" : "127.0.0.1:5000",
    87  //     "Mirrors" : [],
    88  //     "Secure" : false,
    89  //     "Official" : false,
    90  //   },
    91  //   "RemoteName" : "user/repo",
    92  //   "LocalName" : "127.0.0.1:5000/user/repo",
    93  //   "CanonicalName" : "127.0.0.1:5000/user/repo",
    94  //   "Official" : false,
    95  // }
    96  type IndexInfo struct {
    97  	Name     string
    98  	Mirrors  []string
    99  	Secure   bool
   100  	Official bool
   101  }
   102  
   103  type RepositoryInfo struct {
   104  	Index         *IndexInfo
   105  	RemoteName    string
   106  	LocalName     string
   107  	CanonicalName string
   108  	Official      bool
   109  }