Documentation
¶
Overview ¶
Package s3 keeps backups in a bucket of Amazon S3 or of a service that speaks its API (Cloudflare R2, MinIO, Alibaba Cloud OSS, Tencent Cloud COS and others), signing each request with AWS Signature Version 4.
Index ¶
- Variables
- type Bucket
- func (b *Bucket) Check(ctx context.Context) error
- func (b *Bucket) Delete(ctx context.Context, name string) error
- func (b *Bucket) Get(ctx context.Context, name string) ([]byte, error)
- func (b *Bucket) List(ctx context.Context) ([]backup.Object, error)
- func (b *Bucket) Put(ctx context.Context, name string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
var ErrEndpoint = errors.New("s3: endpoint must be an http or https URL with a host, with a valid region and bucket")
ErrEndpoint reports an endpoint that is not an http or https URL with a host (and no user info, query or fragment), a bad region or bucket name.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// Endpoint is "" for AWS (https://s3.<region>.amazonaws.com), else the
// URL of an S3-compatible service.
Endpoint string
// Region is the bucket's region; "" is us-east-1.
Region string
Bucket string
// Prefix is the folder inside the bucket, as "sshyard/"; "" is none.
Prefix string
// PathStyle puts the bucket in the path (as MinIO wants) instead of the
// host name.
PathStyle bool
AccessKey string
SecretKey string
// HTTP is the client requests go through; nil is backup.Client(nil).
HTTP *http.Client
// contains filtered or unexported fields
}
Bucket is a folder of an S3 bucket that keeps backups.