Documentation
¶
Overview ¶
Package s3 is a small client for S3 and the services that speak its protocol, such as Cloudflare R2, Backblaze B2, Wasabi and MinIO. It does only what off-site backups need: put, get, delete and list objects.
Index ¶
- Constants
- type Client
- func (c *Client) Delete(ctx context.Context, key string) error
- func (c *Client) Get(ctx context.Context, key string) (io.ReadCloser, int64, error)
- func (c *Client) List(ctx context.Context, prefix string) ([]Object, error)
- func (c *Client) Put(ctx context.Context, key string, r io.ReaderAt, size int64) error
- type Config
- type Error
- type Object
Constants ¶
View Source
const DefaultRegion = "us-east-1"
DefaultRegion is used when none is given. Services with no regions of their own, R2 among them, accept it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to one bucket.
type Config ¶
type Config struct {
// Endpoint is the service's address, such as
// https://s3.eu-central-1.amazonaws.com.
Endpoint string `json:"endpoint"`
Region string `json:"region"`
Bucket string `json:"bucket"`
AccessKey string `json:"access_key"`
SecretKey string `json:"secret_key"`
}
Config says where a bucket is and how to sign in to it.
Click to show internal directories.
Click to hide internal directories.