Documentation
¶
Overview ¶
Package objectstore manages the existence of the objects an external snapshot is made of: listing them, copying them, and deleting them once nothing owns them any more.
It is deliberately separate from pkg/objectstorage, which reads and writes snapshot content. The control plane never handles those bytes: it copies server-side and deletes by name, so a multi-gigabyte memory image never transits ate-api.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BucketPrefix ¶
func BucketPrefix(uri resources.StoragePrefix) (string, string, error)
BucketPrefix splits a storage prefix into the bucket and the object-name prefix its objects share. The prefix keeps its trailing separator so that it cannot match a sibling whose name it happens to prefix.
func CopyPrefix ¶
CopyPrefix copies every object of the external snapshot at src to dst, keeping each object's name relative to the prefix. The destination is deterministic, so a retry of a partly-completed copy overwrites what it already wrote instead of leaving a second copy behind.
func DeletePrefix ¶
DeletePrefix removes every object under uri: one external snapshot, or every snapshot an owner holds. A prefix with no objects left is already collected, so it succeeds.
Types ¶
type Store ¶
type Store interface {
// List returns the full names of the objects under prefix in bucket.
List(ctx context.Context, bucket, prefix string) ([]string, error)
// Delete removes one object. Deleting an object that is already gone
// succeeds, so a retry over a partly-collected snapshot finishes cleanly.
Delete(ctx context.Context, bucket, object string) error
// Copy copies one object server-side. The destination is overwritten if it
// exists, so a retry re-copying it is harmless.
Copy(ctx context.Context, srcBucket, srcObject, dstBucket, dstObject string) error
}
Store is the object-storage surface the control plane needs. Every method addresses objects by name only.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package objectstoretest provides an in-memory objectstore.Store for tests that need to observe which external snapshots a flow created and released.
|
Package objectstoretest provides an in-memory objectstore.Store for tests that need to observe which external snapshots a flow created and released. |