Documentation ¶
Index ¶
- Variables
- func Pull(ctx context.Context, resolver remotes.Resolver, ref string, ...) (ocispec.Descriptor, []ocispec.Descriptor, error)
- func Push(ctx context.Context, resolver remotes.Resolver, ref string, ...) (ocispec.Descriptor, error)
- func ValidateNameAsPath(desc ocispec.Descriptor) error
- func WithPullByBFS(o *pullOpts) error
- type PullOpt
- type PushOpt
- func WithConfig(config ocispec.Descriptor) PushOpt
- func WithConfigAnnotations(annotations map[string]string) PushOpt
- func WithManifestAnnotations(annotations map[string]string) PushOpt
- func WithNameValidation(validate func(desc ocispec.Descriptor) error) PushOpt
- func WithPushBaseHandler(handlers ...images.Handler) PushOpt
Constants ¶
This section is empty.
Variables ¶
var ( ErrResolverUndefined = errors.New("resolver undefined") ErrEmptyDescriptors = errors.New("empty descriptors") )
Common errors
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
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
WithAllowedMediaType sets the allowed media types
func WithAllowedMediaTypes ¶ added in v0.4.0
WithAllowedMediaTypes sets the allowed media types
func WithPullBaseHandler ¶ added in v0.4.0
WithPullBaseHandler provides base handlers, which will be called before any pull specific handlers.
func WithPullCallbackHandler ¶ added in v0.4.0
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
WithConfigAnnotations overrides the config annotations
func WithManifestAnnotations ¶ added in v0.4.0
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
WithPushBaseHandler provides base handlers, which will be called before any push specific handlers.