feat: add Inspect() method to fetch archive metadata without data blob#21
Merged
Conversation
Adds Client.Inspect() to the public API, allowing users to retrieve manifest metadata and the file index without downloading the data blob. This enables archive introspection with minimal network transfer. New types: - InspectResult: Contains manifest, index, and computed statistics - IndexView: Read-only access to file metadata (Len, Entry, Entries, etc.) - Referrer: Describes referrer artifacts (signatures, attestations) Features: - Access file count, sizes, and compression ratio without pulling data - Iterate file entries with path, size, mode, and hash information - Lazy-load referrers via InspectResult.Referrers() - Options: InspectWithSkipCache(), InspectWithMaxIndexSize() Implementation: - registry/inspect.go: Registry-layer Inspect implementation - core/index_view.go: IndexView type wrapping internal index - blob/inspect.go: Public InspectResult with computed stats - blob/referrer.go: Referrer type for OCI referrers Documentation: - Updated API reference with Inspect, InspectResult, IndexView, Referrer - Added Step 4 (Inspect) to getting-started guide - Added Inspect Operations section to OCI client guide Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
blob | 309f474 | Commit Preview URL Branch Preview URL |
Jan 20 2026, 03:51 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Client.Inspect()to fetch manifest and file index without downloading the data blobInspectResult.Referrers()New Types
InspectResultContains manifest, index, and computed statistics:
Manifest(),Index(),Digest(),Created()FileCount(),DataBlobSize(),IndexBlobSize()TotalUncompressedSize(),TotalCompressedSize(),CompressionRatio()(computed lazily)Referrers(ctx, artifactType)for fetching signatures/attestationsIndexViewRead-only access to file metadata without the data blob:
Len(),Version(),DataHash(),DataSize()Entry(path),Entries(),EntriesWithPrefix(prefix)ReferrerDescribes referrer artifacts:
Digest,Size,MediaType,ArtifactType,AnnotationsOptions
InspectWithSkipCache()- Bypass all cachesInspectWithMaxIndexSize(size)- Limit index blob sizeExample Usage
Files Changed
New files:
inspect.go- PublicInspectResultandClient.Inspect()referrer.go-Referrertypecore/index_view.go-IndexViewtyperegistry/inspect.go- Registry-layer implementationregistry/inspect_opts.go- Inspect optionsregistry/inspect_test.go- Registry layer testsregistry/testing.go- Test helpersinspect_test.go- Blob layer testsModified files:
types.go- AddedIndexViewre-exportcore/testutil/index.go- AddedMakeMinimalIndex()helperDocumentation:
docs/docs/reference/api.md- Added Inspect, InspectResult, IndexView, Referrerdocs/docs/getting-started.md- Added Step 4: Inspect Archive Metadatadocs/docs/guides/oci-client.md- Added Inspect Operations sectionTest plan
just ci)registry/inspect_test.go)inspect_test.go)🤖 Generated with Claude Code