Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions oras/copy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
"""
ORAS Copy Engine.

Provides a complete OCI content copy implementation that copies content
DAGs between OCI targets (registries, OCI layouts, in-memory stores, etc.).

This is a Python port of the copy engine from oras-go
(https://github.com/oras-project/oras-go).

Public API:
copy() - Copy content between targets by reference
CopyOptions - Options for the copy function
CopyGraphOptions - Options for graph traversal behavior
SkipNode - Sentinel to skip a node in pre_copy callbacks
CopyError - Structured error with operation and origin info
CopyErrorOrigin - Source or destination origin enum

Content Protocols:
Target - Full read/write target with tag/resolve
ReadOnlyTarget - Read-only target with resolve
Storage - Content-addressable read/write storage
ReadOnlyStorage - Content-addressable read-only storage
ReferencePusher - Atomic push with reference tag
ReferenceFetcher - Fetch by reference (resolve + fetch in one call)
Mounter - Cross-repo blob mounting

Adapters:
RegistryTarget - Adapts Registry + container to Target/ReferencePusher/Mounter
LayoutTarget - Adapts Layout directory to Target (full read/write)
"""

__author__ = "The ORAS Authors"
__copyright__ = "Copyright The ORAS Authors."
__license__ = "Apache-2.0"

from oras.copy.content import (
Fetcher,
Mounter,
Pusher,
ReadOnlyStorage,
ReadOnlyTarget,
ReferenceFetcher,
ReferencePusher,
Resolver,
Storage,
Tagger,
TagResolver,
Target,
)
from oras.copy.adapters import LayoutTarget, RegistryTarget
from oras.copy.copy import copy
from oras.copy.errors import CopyError, CopyErrorOrigin
from oras.copy.graph import SkipNode
from oras.copy.options import CopyGraphOptions, CopyOptions
from oras.types import Descriptor

__all__ = [
# Core function
"copy",
# Options
"CopyOptions",
"CopyGraphOptions",
# Sentinel
"SkipNode",
# Errors
"CopyError",
"CopyErrorOrigin",
# Types
"Descriptor",
# Content Protocols
"Fetcher",
"Pusher",
"Storage",
"ReadOnlyStorage",
"Resolver",
"Tagger",
"TagResolver",
"Target",
"ReadOnlyTarget",
# Registry Protocols
"ReferencePusher",
"ReferenceFetcher",
"Mounter",
# Adapters
"RegistryTarget",
"LayoutTarget",
]
Loading