Documentation
¶
Overview ¶
Package ocilayout provides an oci.Interface implementation backed by an OCI Image Layout directory.
Index ¶
- func FindLayout(path string) (baseDir string, ref ociref.Reference, err error)
- func NewPerRepository(dir string, _ *PerRepoOptions) (oci.Interface, error)
- type Options
- type PerRepoOptions
- type Registry
- func (r *Registry) DeleteBlob(ctx context.Context, repo string, digest oci.Digest) error
- func (r *Registry) DeleteManifest(ctx context.Context, repo string, digest oci.Digest) error
- func (r *Registry) DeleteTag(ctx context.Context, repo string, tagName string) error
- func (r *Registry) GetBlob(ctx context.Context, repo string, digest oci.Digest) (oci.BlobReader, error)
- func (r *Registry) GetBlobRange(ctx context.Context, repo string, digest oci.Digest, offset0, offset1 int64) (oci.BlobReader, error)
- func (r *Registry) GetManifest(ctx context.Context, repo string, digest oci.Digest) (oci.BlobReader, error)
- func (r *Registry) GetTag(ctx context.Context, repo string, tagName string) (oci.BlobReader, error)
- func (r *Registry) MountBlob(ctx context.Context, fromRepo, toRepo string, dig oci.Digest) (oci.Descriptor, error)
- func (r *Registry) PushBlob(ctx context.Context, repo string, desc oci.Descriptor, content io.Reader) (oci.Descriptor, error)
- func (r *Registry) PushBlobChunked(ctx context.Context, repo string, chunkSize int) (oci.BlobWriter, error)
- func (r *Registry) PushBlobChunkedResume(ctx context.Context, repo string, id string, offset int64, chunkSize int) (oci.BlobWriter, error)
- func (r *Registry) PushManifest(ctx context.Context, repo string, data []byte, mediaType string, ...) (oci.Descriptor, error)
- func (r *Registry) Referrers(ctx context.Context, repo string, digest oci.Digest, ...) iter.Seq2[oci.Descriptor, error]
- func (r *Registry) Repositories(ctx context.Context, startAfter string) iter.Seq2[string, error]
- func (r *Registry) ResolveBlob(ctx context.Context, repo string, digest oci.Digest) (oci.Descriptor, error)
- func (r *Registry) ResolveManifest(ctx context.Context, repo string, digest oci.Digest) (oci.Descriptor, error)
- func (r *Registry) ResolveTag(ctx context.Context, repo string, tagName string) (oci.Descriptor, error)
- func (r *Registry) Tags(ctx context.Context, repo string, params *oci.TagsParameters) iter.Seq2[string, error]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindLayout ¶
FindLayout splits path into an OCI image layout directory and image reference.
It first looks for OCI layout marker files in directory prefixes of path. If one or more marker files are found, the deepest directory whose remaining suffix parses as a reference is used as the base directory. If no marker file matches, FindLayout falls back to treating the last path component as the reference and the preceding path as the base directory.
func NewPerRepository ¶
func NewPerRepository(dir string, _ *PerRepoOptions) (oci.Interface, error)
NewPerRepository opens an OCI Image Layout registry that stores each repository in a separate OCI layout under dir.
Types ¶
type Options ¶
type Options struct {
// DefaultRepo is used when reading layout entries whose
// org.opencontainers.image.ref.name annotation is empty or tag-only.
DefaultRepo string
}
Options holds configuration for opening a layout registry.
type PerRepoOptions ¶
type PerRepoOptions struct{}
PerRepoOptions holds configuration for opening a per-repository layout registry.
type Registry ¶
Registry is an OCI Image Layout backed implementation of oci.Interface.
func New ¶
New opens an OCI Image Layout registry rooted at dir.
Missing layout files are not created by New. Write operations create the required layout files and directories lazily.
func (*Registry) DeleteBlob ¶
DeleteBlob deletes the blob with the given digest from the named repository.
func (*Registry) DeleteManifest ¶
DeleteManifest deletes top-level index entries for the manifest digest.
func (*Registry) GetBlob ¶
func (r *Registry) GetBlob(ctx context.Context, repo string, digest oci.Digest) (oci.BlobReader, error)
GetBlob returns the content of the blob with the given digest.
func (*Registry) GetBlobRange ¶
func (r *Registry) GetBlobRange(ctx context.Context, repo string, digest oci.Digest, offset0, offset1 int64) (oci.BlobReader, error)
GetBlobRange returns a range of bytes from the blob with the given digest.
func (*Registry) GetManifest ¶
func (r *Registry) GetManifest(ctx context.Context, repo string, digest oci.Digest) (oci.BlobReader, error)
GetManifest returns the content of the manifest with the given digest.
func (*Registry) MountBlob ¶
func (r *Registry) MountBlob(ctx context.Context, fromRepo, toRepo string, dig oci.Digest) (oci.Descriptor, error)
MountBlob makes a blob from one repository available in another.
func (*Registry) PushBlob ¶
func (r *Registry) PushBlob(ctx context.Context, repo string, desc oci.Descriptor, content io.Reader) (oci.Descriptor, error)
PushBlob pushes a blob described by desc to the given repository.
func (*Registry) PushBlobChunked ¶
func (r *Registry) PushBlobChunked(ctx context.Context, repo string, chunkSize int) (oci.BlobWriter, error)
PushBlobChunked starts a chunked blob upload to the given repository.
func (*Registry) PushBlobChunkedResume ¶
func (r *Registry) PushBlobChunkedResume(ctx context.Context, repo string, id string, offset int64, chunkSize int) (oci.BlobWriter, error)
PushBlobChunkedResume resumes a previous chunked blob upload.
func (*Registry) PushManifest ¶
func (r *Registry) PushManifest(ctx context.Context, repo string, data []byte, mediaType string, params *oci.PushManifestParameters) (oci.Descriptor, error)
PushManifest pushes a manifest to the named repository, optionally tagging it.
func (*Registry) Referrers ¶
func (r *Registry) Referrers(ctx context.Context, repo string, digest oci.Digest, params *oci.ReferrersParameters) iter.Seq2[oci.Descriptor, error]
Referrers returns descriptors that refer to the given digest.
func (*Registry) Repositories ¶
Repositories returns an iterator over repository names in the layout registry.
func (*Registry) ResolveBlob ¶
func (r *Registry) ResolveBlob(ctx context.Context, repo string, digest oci.Digest) (oci.Descriptor, error)
ResolveBlob returns the descriptor for the blob with the given digest.
func (*Registry) ResolveManifest ¶
func (r *Registry) ResolveManifest(ctx context.Context, repo string, digest oci.Digest) (oci.Descriptor, error)
ResolveManifest returns the descriptor for the manifest with the given digest.
func (*Registry) ResolveTag ¶
func (r *Registry) ResolveTag(ctx context.Context, repo string, tagName string) (oci.Descriptor, error)
ResolveTag returns the descriptor for the manifest with the given tag.