File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 55require (
66 github.com/chaitin/libveinmind v1.1.1
77 github.com/containerd/containerd v1.6.6
8+ github.com/distribution/distribution v2.8.1+incompatible // indirect
89 github.com/docker/cli v20.10.17+incompatible
910 github.com/docker/distribution v2.8.1+incompatible
1011 github.com/docker/docker v20.10.17+incompatible
Original file line number Diff line number Diff line change @@ -397,6 +397,8 @@ github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11
397397github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM =
398398github.com/dgrijalva/jwt-go v3.2.0+incompatible /go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ =
399399github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954 /go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no =
400+ github.com/distribution/distribution v2.8.1+incompatible h1:8iXUoOqRPx30bhzIEPUmNIqlmBlWdrieW1bqr6LrX30 =
401+ github.com/distribution/distribution v2.8.1+incompatible /go.mod h1:EgLm2NgWtdKgzF9NpMzUKgzmR7AMmb0VQi2B+ZzDRjc =
400402github.com/dnaeon/go-vcr v1.0.1 /go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E =
401403github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017 /go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8 =
402404github.com/docker/cli v20.10.16+incompatible /go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8 =
Original file line number Diff line number Diff line change 1+ package registry
2+
3+ import (
4+ "encoding/json"
5+ "github.com/distribution/distribution/manifest/schema2"
6+ "github.com/google/go-containerregistry/pkg/name"
7+ "github.com/google/go-containerregistry/pkg/v1/remote"
8+ )
9+
10+ type Client struct {
11+ }
12+
13+ func NewClient () (* Client , error ) {
14+ c := new (Client )
15+ return c , nil
16+ }
17+
18+ func (client * Client ) GetRepoTags (repo string , options ... remote.Option ) ([]string , error ) {
19+ repoR , err := name .NewRepository (repo )
20+ if err != nil {
21+ return nil , err
22+ }
23+ return remote .List (repoR , options ... )
24+ }
25+
26+ func (client * Client ) GetRepoManifest (repo string , options ... remote.Option ) (* schema2.Manifest , error ) {
27+ ref , err := name .ParseReference (repo )
28+ if err != nil {
29+ return nil , err
30+ }
31+
32+ desc , err := remote .Get (ref , options ... )
33+ if err != nil {
34+ return nil , err
35+ }
36+
37+ manifest := & schema2.Manifest {}
38+ err = json .Unmarshal (desc .Manifest , manifest )
39+ if err != nil {
40+ return nil , err
41+ }
42+
43+ return manifest , nil
44+ }
You can’t perform that action at this time.
0 commit comments