orasclient

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(options ...ClientOption) (registryclient.Client, error)

NewClient returns a new ORAS client implementation

Types

type AuthStore

type AuthStore struct {
	// contains filtered or unexported fields
}

AuthStore contains authentication configuration file information for registry interactions.

func NewAuthStore

func NewAuthStore(configPaths ...string) (*AuthStore, error)

NewAuthStore returns a new authentication store instance with credential information collected.

func (*AuthStore) Credential

func (s *AuthStore) Credential(_ context.Context, registry string) (auth.Credential, error)

Credential iterates all the config files, returns the first non-empty credential in a best-effort way.

type ClientConfig

type ClientConfig struct {
	// contains filtered or unexported fields
}

ClientConfig contains configuration data for the registry client.

type ClientOption

type ClientOption func(o *ClientConfig) error

ClientOption is a function that configures options on the client config.

func SkipTLSVerify

func SkipTLSVerify(insecure bool) ClientOption

SkipTLSVerify disables TLS certificate checking.

func WithAuthConfigs

func WithAuthConfigs(configs []string) ClientOption

WithAuthConfigs adds configuration files with registry authorization information.

func WithCache

func WithCache(store content.Store) ClientOption

WithCache uses the provided storage a cache to be used with remote resources. It is the responsibility of the caller to perform any clean up actions.

func WithCredentialFunc added in v0.4.0

func WithCredentialFunc(credFn func(context.Context, string) (auth.Credential, error)) ClientOption

WithCredentialFunc overrides the default credential function. Using this option will override WithAuthConfigs.

func WithPlainHTTP

func WithPlainHTTP(plainHTTP bool) ClientOption

WithPlainHTTP uses the HTTP protocol with the registry.

func WithPostCopy

func WithPostCopy(postFn func(ctx context.Context, desc ocispec.Descriptor) error) ClientOption

WithPostCopy applies a function to a descriptor after copying it. This sets the oras.CopyOptions.PostCopy function.

func WithPreCopy

func WithPreCopy(preFn func(ctx context.Context, desc ocispec.Descriptor) error) ClientOption

WithPreCopy applies a function to a descriptor before copying it. This sets the oras.CopyOptions.PreCopy function.

func WithPrePullFunc added in v0.4.0

func WithPrePullFunc(prePullFn func(context.Context, string) error) ClientOption

WithPrePullFunc applies a function to a reference before pulling it to a content store.

func WithPullableAttributes added in v0.4.0

func WithPullableAttributes(filter model.Matcher) ClientOption

WithPullableAttributes adds a filter when pulling blobs that allows non-matching blobs to be skipped.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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