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

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

func WithPullByBFS(o *pullOpts) error

WithPullByBFS opt to pull in sequence with breath-first search

Types

type PullOpt

type PullOpt func(o *pullOpts) error

PullOpt allows callers to set options on the oras pull

func WithAllowedMediaType

func WithAllowedMediaType(allowedMediaTypes ...string) PullOpt

WithAllowedMediaType sets the allowed media types

func WithAllowedMediaTypes

func WithAllowedMediaTypes(allowedMediaTypes []string) PullOpt

WithAllowedMediaTypes sets the allowed media types

func WithPullBaseHandler

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

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

func WithPullCallbackHandler

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

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

type PushOpt

type PushOpt func(o *pushOpts) error

PushOpt allows callers to set options on the oras push

func WithConfig

func WithConfig(config ocispec.Descriptor) PushOpt

WithConfig overrides the config

func WithConfigAnnotations

func WithConfigAnnotations(annotations map[string]string) PushOpt

WithConfigAnnotations overrides the config annotations

func WithManifestAnnotations

func WithManifestAnnotations(annotations map[string]string) PushOpt

WithManifestAnnotations overrides the manifest annotations

func WithNameValidation

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

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