oras

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDirtyPath               = errors.New("dirty path")
	ErrPathNotSlashSeparated   = errors.New("path not slash separated")
	ErrAbsolutePathDisallowed  = errors.New("absolute path disallowed")
	ErrPathTraversalDisallowed = errors.New("path traversal disallowed")
)

Path validation related errors

View Source
var (
	ErrResolverUndefined = errors.New("resolver undefined")
)

Common errors

View Source
var ErrStopProcessing = fmt.Errorf("stop processing")

ErrStopProcessing is used to stop processing an oras operation. This error only makes sense in sequential pulling operation.

Functions

func Pull

func Pull(ctx context.Context, resolver remotes.Resolver, ref string, ingester content.Ingester, opts ...PullOpt) (ocispec.Descriptor, []ocispec.Descriptor, error)

Pull pull files from the remote

func Push

func Push(ctx context.Context, resolver remotes.Resolver, ref string, provider content.Provider, descriptors []ocispec.Descriptor, opts ...PushOpt) (ocispec.Descriptor, error)

Push pushes files to the remote

func ValidateNameAsPath added in v0.4.0

func ValidateNameAsPath(desc ocispec.Descriptor) error

ValidateNameAsPath validates name in the descriptor as file path in order to generate good packages intended to be pulled using the FileStore or the oras cli. For cross-platform considerations, only unix paths are accepted.

func WithPullByBFS added in v0.4.0

func WithPullByBFS(o *pullOpts) error

WithPullByBFS opt to pull in sequence with breath-first search

Types

type PullOpt added in v0.4.0

type PullOpt func(o *pullOpts) error

PullOpt allows callers to set options on the oras pull

func WithAdditionalCachedMediaTypes added in v0.11.0

func WithAdditionalCachedMediaTypes(cachedMediaTypes ...string) PullOpt

WithAdditionalCachedMediaTypes adds media types normally cached in memory when pulling. This does not replace the default media types, but appends to them

func WithAllowedMediaType added in v0.4.0

func WithAllowedMediaType(allowedMediaTypes ...string) PullOpt

WithAllowedMediaType sets the allowed media types

func WithAllowedMediaTypes added in v0.4.0

func WithAllowedMediaTypes(allowedMediaTypes []string) PullOpt

WithAllowedMediaTypes sets the allowed media types

func WithCachedMediaTypes added in v0.11.0

func WithCachedMediaTypes(cachedMediaTypes ...string) PullOpt

WithCachedMediaTypes sets the media types normally cached in memory when pulling.

func WithContentProvideIngester added in v0.6.0

func WithContentProvideIngester(store orascontent.ProvideIngester) PullOpt

WithContentProvideIngester opt to the provided Provider and Ingester for file system I/O, including caches.

func WithPullBaseHandler added in v0.4.0

func WithPullBaseHandler(handlers ...images.Handler) PullOpt

WithPullBaseHandler provides base handlers, which will be called before any pull specific handlers.

func WithPullCallbackHandler added in v0.4.0

func WithPullCallbackHandler(handlers ...images.Handler) PullOpt

WithPullCallbackHandler provides callback handlers, which will be called after any pull specific handlers.

func WithPullEmptyNameAllowed added in v0.6.0

func WithPullEmptyNameAllowed() PullOpt

WithPullEmptyNameAllowed allows pulling blobs with empty name.

func WithPullStatusTrack added in v0.9.0

func WithPullStatusTrack(writer io.Writer) PullOpt

WithPullStatusTrack report results to stdout

type PushOpt added in v0.4.0

type PushOpt func(o *pushOpts) error

PushOpt allows callers to set options on the oras push

func WithConfig added in v0.4.0

func WithConfig(config ocispec.Descriptor) PushOpt

WithConfig overrides the config - setting this will ignore WithConfigMediaType and WithConfigAnnotations

func WithConfigAnnotations added in v0.4.0

func WithConfigAnnotations(annotations map[string]string) PushOpt

WithConfigAnnotations overrides the config annotations

func WithConfigMediaType added in v0.5.0

func WithConfigMediaType(mediaType string) PushOpt

WithConfigMediaType overrides the config media type

func WithManifest added in v0.8.0

func WithManifest(manifest ocispec.Descriptor) PushOpt

WithManifest overrides the manifest - setting this will ignore WithManifestConfigAnnotations

func WithManifestAnnotations added in v0.4.0

func WithManifestAnnotations(annotations map[string]string) PushOpt

WithManifestAnnotations overrides the manifest annotations

func WithNameValidation added in v0.4.0

func WithNameValidation(validate func(desc ocispec.Descriptor) error) PushOpt

WithNameValidation validates the image title in the descriptor. Pass nil to disable name validation.

func WithPushBaseHandler added in v0.4.0

func WithPushBaseHandler(handlers ...images.Handler) PushOpt

WithPushBaseHandler provides base handlers, which will be called before any push specific handlers.

func WithPushStatusTrack added in v0.9.0

func WithPushStatusTrack(writer io.Writer) PushOpt

WithPushStatusTrack report results to a provided writer

Jump to

Keyboard shortcuts

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