Documentation ¶
Index ¶
- Variables
- func Discover(ctx context.Context, resolver remotes.Resolver, ref, artifactType string) (ocispec.Descriptor, []artifactspec.Descriptor, error)
- 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
- func WithAdditionalCachedMediaTypes(cachedMediaTypes ...string) PullOpt
- func WithAllowedMediaType(allowedMediaTypes ...string) PullOpt
- func WithAllowedMediaTypes(allowedMediaTypes []string) PullOpt
- func WithCachedMediaTypes(cachedMediaTypes ...string) PullOpt
- func WithContentProvideIngester(store orascontent.ProvideIngester) PullOpt
- func WithPullBaseHandler(handlers ...images.Handler) PullOpt
- func WithPullCallbackHandler(handlers ...images.Handler) PullOpt
- func WithPullEmptyNameAllowed() PullOpt
- func WithPullStatusTrack(writer io.Writer) PullOpt
- type PushOpt
- func AsArtifact(artifactType string, manifest ocispec.Descriptor) PushOpt
- func WithConfig(config ocispec.Descriptor) PushOpt
- func WithConfigAnnotations(annotations map[string]string) PushOpt
- func WithConfigMediaType(mediaType string) PushOpt
- func WithManifest(manifest ocispec.Descriptor) PushOpt
- func WithManifestAnnotations(annotations map[string]string) PushOpt
- func WithManifestWriter(writer io.Writer) PushOpt
- func WithNameValidation(validate func(desc ocispec.Descriptor) error) PushOpt
- func WithPushBaseHandler(handlers ...images.Handler) PushOpt
- func WithPushStatusTrack(writer io.Writer) PushOpt
Constants ¶
This section is empty.
Variables ¶
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 (
ErrResolverUndefined = errors.New("resolver undefined")
)
Common 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 Discover ¶
func Discover(ctx context.Context, resolver remotes.Resolver, ref, artifactType string) (ocispec.Descriptor, []artifactspec.Descriptor, error)
Discover discovers artifacts referencing the specified artifact
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
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
WithAllowedMediaType sets the allowed media types
func WithAllowedMediaTypes ¶ added in v0.4.0
WithAllowedMediaTypes sets the allowed media types
func WithCachedMediaTypes ¶ added in v0.11.0
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
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.
func WithPullEmptyNameAllowed ¶ added in v0.6.0
func WithPullEmptyNameAllowed() PullOpt
WithPullEmptyNameAllowed allows pulling blobs with empty name.
func WithPullStatusTrack ¶ added in v0.9.0
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 AsArtifact ¶
func AsArtifact(artifactType string, manifest ocispec.Descriptor) PushOpt
AsArtifact set oras to push contents as an artifact
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
WithConfigAnnotations overrides the config annotations
func WithConfigMediaType ¶ added in v0.5.0
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
WithManifestAnnotations overrides the manifest annotations
func WithManifestWriter ¶
WithManifestWriter exports the pushed manifest
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.
func WithPushStatusTrack ¶ added in v0.9.0
WithPushStatusTrack report results to a provided writer