Documentation
¶
Overview ¶
Package s3 stores backup bundles in an S3-compatible bucket: Amazon S3, MinIO, Cloudflare R2, Backblaze B2 and anything else that speaks the S3 API.
The off-host destination (R-217, R-417; resolves O-69). A bundle in a bucket survives the host Pando runs on, so this kind reports OffHost and a second host may join an install whose default backup destination it is.
Bundles are streamed: a write is a multipart upload sent a part at a time, so at most one part is held in memory whatever the bundle's size, and nothing is visible in the bucket until the upload completes — S3 shows a multipart object only once CompleteMultipartUpload returns, which is the atomic write the interface asks for (R-215). A read is the response body, unbuffered.
Retention is Pando's (R-211): the adapter cannot see a lifecycle rule, and saying the bucket owns retention when it does not would keep every bundle forever.
Index ¶
- Constants
- func Info() api.KindInfo
- type Adapter
- func (a *Adapter) Capabilities() api.BackupCapabilities
- func (a *Adapter) Category() api.Category
- func (a *Adapter) Configure(_ context.Context, raw json.RawMessage) error
- func (a *Adapter) Delete(ctx context.Context, name string) error
- func (a *Adapter) HealthCheck(ctx context.Context) error
- func (a *Adapter) Kind() string
- func (a *Adapter) List(ctx context.Context) ([]api.StoredBundle, error)
- func (a *Adapter) Reader(ctx context.Context, name string) (io.ReadCloser, error)
- func (a *Adapter) Writer(ctx context.Context, name string) (io.WriteCloser, error)
Constants ¶
const Kind = "s3"
Kind is the adapter kind.
const ( // PartSize is how much of a bundle is held in memory and sent as one part // [P]. S3 refuses parts under 5 MiB except the last, and an upload has at // most maxParts of them, so this also sets the largest bundle. PartSize = 32 << 20 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter is one bucket, under an optional prefix.
func (*Adapter) Capabilities ¶
func (a *Adapter) Capabilities() api.BackupCapabilities
Capabilities: off the host, retention Pando's, and as large as maxParts parts of PartSize.
func (*Adapter) Configure ¶
Configure reads the bucket's settings and the access key. Nothing is sent to the store here; HealthCheck is what proves the key can write.
func (*Adapter) Delete ¶
Delete removes a bundle. Deleting one that is not there succeeds, as S3 does.
func (*Adapter) HealthCheck ¶
HealthCheck writes and removes a probe object.
Not a HeadBucket: a key that may read the bucket and not write to it is the failure this needs to catch, and it must be caught before the disaster rather than during it.
func (*Adapter) List ¶
List returns every bundle directly under the prefix. Keys further down and names starting with a dot are not Pando's bundles.