Documentation
¶
Overview ¶
Package backup implements encrypted addon backups to S3-compatible storage and the minimal AWS Signature V4 client they need. The client is stdlib-only (golden rule 7): no SDK.
Index ¶
- Variables
- func SizeString(n int64) string
- type Object
- type S3
- func (s *S3) Delete(ctx context.Context, key string) error
- func (s *S3) Get(ctx context.Context, key string) (io.ReadCloser, error)
- func (s *S3) List(ctx context.Context, prefix string) ([]Object, error)
- func (s *S3) Put(ctx context.Context, key string, body io.Reader, size int64) error
- func (s *S3) Validate() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("s3: object not found")
ErrNotFound is returned by Get for a missing key.
Functions ¶
Types ¶
type S3 ¶
type S3 struct {
// Endpoint is the service URL, e.g. https://s3.eu-central-1.amazonaws.com or
// http://minio:9000 (MinIO, path-style).
Endpoint string
Region string
Bucket string
AccessKey string
SecretKey string
// PathStyle addresses objects as <endpoint>/<bucket>/<key> (MinIO); otherwise the bucket
// becomes a host prefix.
PathStyle bool
HTTP *http.Client
// Now is overridable for tests (signing uses it).
Now func() time.Time
}
S3 is a minimal SigV4 client for PUT/GET/DELETE/LIST on one bucket.
Click to show internal directories.
Click to hide internal directories.