remote

package
v0.0.0-...-2440f66 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ChunkSize int64 = 500 * 1024 * 1024

We always use multipart upload for backend, and limit the multipart chunk size to 500MB by default.

Variables

This section is empty.

Functions

func NewResolver

func NewResolver(insecure, plainHTTP bool, credFunc CredentialFunc) remotes.Resolver

func RetryWithHTTP

func RetryWithHTTP(err error) bool

func WithRetry

func WithRetry(op func() error) error

Types

type CredentialFunc

type CredentialFunc = func(string) (string, string, error)

CredentialFunc accepts host url parameter and returns with username, password and error.

func NewDockerConfigCredFunc

func NewDockerConfigCredFunc() CredentialFunc

NewDockerConfigCredFunc attempts to read docker auth config file `$DOCKER_CONFIG/config.json` to communicate with remote registry, `$DOCKER_CONFIG` defaults to `~/.docker`.

type HostFunc

type HostFunc = func(ref string) (CredentialFunc, bool, error)

HostFunc accepts host url parameter and returns with CredentialFunc, insecure and error.

type Remote

type Remote struct {
	// `Ref` is pointing to a remote image in formatted string host[:port]/[namespace/]repo[:tag]
	Ref string
	// contains filtered or unexported fields
}

Remote provides the ability to access remote registry

func New

func New(ref string, resolverFunc func(bool) remotes.Resolver) (*Remote, error)

New creates remote instance from docker remote resolver

func (*Remote) IsWithHTTP

func (remote *Remote) IsWithHTTP() bool

func (*Remote) MaybeWithHTTP

func (remote *Remote) MaybeWithHTTP(err error)

func (*Remote) Pull

func (remote *Remote) Pull(ctx context.Context, desc ocispec.Descriptor, byDigest bool) (io.ReadCloser, error)

Pull pulls blob from registry

func (*Remote) Push

func (remote *Remote) Push(ctx context.Context, desc ocispec.Descriptor, byDigest bool, reader io.Reader) error

Push pushes blob to registry

func (*Remote) Resolve

func (remote *Remote) Resolve(ctx context.Context) (*ocispec.Descriptor, error)

Resolve parses descriptor for given image reference

Jump to

Keyboard shortcuts

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