Documentation ¶
Index ¶
- func ListTags(ctx context.Context, image string, options ...DistributionOption) (*specsv1.TagList, error)
- func ParseImage(image string) (domain, path, name, tag string, err error)
- func Ping(ctx context.Context, server string, options ...DistributionOption) error
- type DistributionOption
- type DistributionOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListTags ¶
func ListTags(ctx context.Context, image string, options ...DistributionOption) (*specsv1.TagList, error)
end-8a GET /v2/<name>/tags/list
func ParseImage ¶
barbor.foo.com/project/artifact:tag -> barbor.foo.com,project,artifact,tag barbor.foo.com/project/foo/artifact:tag -> barbor.foo.com,project/foo,artifact,tag barbor.foo.com/artifact:tag -> barbor.foo.com,library,artifact,tag project/artifact:tag -> docker.io,project,artifact,tag
func Ping ¶
func Ping(ctx context.Context, server string, options ...DistributionOption) error
参考OCI规范此段实现 https://github.com/opencontainers/distribution-spec/blob/main/spec.md#determining-support 目前大部分(所有)镜像仓库均实现了OCI Distribution 规范,可以使用 /v2 接口进行推断, 如果认证成功则返回200则认为实现了OCI且认证成功 end-1 GET /v2/ 200 404/401
Types ¶
type DistributionOption ¶
type DistributionOption func(*DistributionOptions)
func WithAuth ¶
func WithAuth(username, password string) DistributionOption
func WithInsecure ¶
func WithInsecure() DistributionOption
type DistributionOptions ¶
Click to show internal directories.
Click to hide internal directories.