Documentation
¶
Overview ¶
Package registry stores and retrieves OCI blobs and manifests in S3, plus maintains a global catalog index. Vendor-agnostic; cocoonstack concepts live in the snapshot and cloudimg packages.
Index ¶
- type Registry
- func (r *Registry) BlobExists(ctx context.Context, digest string) (bool, error)
- func (r *Registry) BlobSize(ctx context.Context, digest string) (int64, error)
- func (r *Registry) DeleteBlob(ctx context.Context, digest string) error
- func (r *Registry) DeleteManifest(ctx context.Context, name, tag string) error
- func (r *Registry) GetCatalog(ctx context.Context) (*manifest.Catalog, error)
- func (r *Registry) GetCatalogWithDigest(ctx context.Context) (*manifest.Catalog, string, error)
- func (r *Registry) ListTags(ctx context.Context, name string) ([]string, error)
- func (r *Registry) ManifestJSON(ctx context.Context, name, tag string) ([]byte, error)
- func (r *Registry) ManifestJSONByDigest(ctx context.Context, name, digest string) ([]byte, error)
- func (r *Registry) PushBlobFromStream(ctx context.Context, digest string, body io.Reader, size int64) error
- func (r *Registry) PushManifestJSON(ctx context.Context, name, tag string, data []byte) error
- func (r *Registry) PushManifestJSONByDigest(ctx context.Context, name string, data []byte) (string, error)
- func (r *Registry) StreamBlob(ctx context.Context, digest string) (io.ReadCloser, int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is the storage facade. Safe for concurrent use.
func New ¶
func New(client *objectstore.Client) *Registry
New creates a Registry backed by the given object store client.
func NewFromEnv ¶
NewFromEnv creates a Registry using S3 configuration from environment variables.
func (*Registry) BlobExists ¶
BlobExists reports whether a blob with the given digest exists.
func (*Registry) DeleteBlob ¶
DeleteBlob removes a blob from the object store.
func (*Registry) DeleteManifest ¶
DeleteManifest removes a manifest tag and updates the catalog.
func (*Registry) GetCatalog ¶
GetCatalog returns the parsed global catalog index.
func (*Registry) GetCatalogWithDigest ¶ added in v0.1.7
GetCatalogWithDigest returns the parsed catalog and its SHA-256 digest.
func (*Registry) ManifestJSON ¶
ManifestJSON fetches a manifest by repository name and tag.
func (*Registry) ManifestJSONByDigest ¶ added in v0.1.7
ManifestJSONByDigest fetches a manifest by repository name and content digest.
func (*Registry) PushBlobFromStream ¶
func (r *Registry) PushBlobFromStream(ctx context.Context, digest string, body io.Reader, size int64) error
PushBlobFromStream uploads a blob, deduplicating if it already exists.
func (*Registry) PushManifestJSON ¶
PushManifestJSON uploads a manifest under both the tag and digest keys, then updates the catalog.
func (*Registry) PushManifestJSONByDigest ¶ added in v0.1.7
func (r *Registry) PushManifestJSONByDigest(ctx context.Context, name string, data []byte) (string, error)
PushManifestJSONByDigest stores a manifest by digest only (no tag, no catalog update). Used for OCI index child manifests. Returns the computed digest.
func (*Registry) StreamBlob ¶
StreamBlob returns a streaming reader and size. Caller must close the reader.