oras

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Common errors

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 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 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 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.

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

func WithConfigAnnotations added in v0.4.0

func WithConfigAnnotations(annotations map[string]string) PushOpt

WithConfigAnnotations overrides the config annotations

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.

Jump to

Keyboard shortcuts

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