oci

package
v0.0.0-...-602fb03 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

func ParseImage(image string) (domain, path, name, tag string, err error)

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

type DistributionOptions struct {
	Username string
	Password string
	Insecure bool // skip tls verify
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL