Help us shape the future of Go! Take the 2026 Go Developer Survey

s3

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

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

View Source
const Kind = "s3"

Kind is the adapter kind.

View Source
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

func Info

func Info() api.KindInfo

Info describes this kind of adapter for the forms that configure one (api.KindInfo, R-261).

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter is one bucket, under an optional prefix.

func New

func New() *Adapter

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) Category

func (a *Adapter) Category() api.Category

func (*Adapter) Configure

func (a *Adapter) Configure(_ context.Context, raw json.RawMessage) error

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

func (a *Adapter) Delete(ctx context.Context, name string) error

Delete removes a bundle. Deleting one that is not there succeeds, as S3 does.

func (*Adapter) HealthCheck

func (a *Adapter) HealthCheck(ctx context.Context) error

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) Kind

func (a *Adapter) Kind() string

func (*Adapter) List

func (a *Adapter) List(ctx context.Context) ([]api.StoredBundle, error)

List returns every bundle directly under the prefix. Keys further down and names starting with a dot are not Pando's bundles.

func (*Adapter) Reader

func (a *Adapter) Reader(ctx context.Context, name string) (io.ReadCloser, error)

func (*Adapter) Writer

func (a *Adapter) Writer(ctx context.Context, name string) (io.WriteCloser, error)

Writer opens a bundle as an upload that becomes visible only when Close returns without error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL