Documentation
¶
Overview ¶
Package s3 stores objects in an S3-compatible service: Amazon S3, DigitalOcean Spaces, Cloudflare R2 or MinIO (ADR-0075), through the MinIO client. Signed URLs are the service's presigned URLs.
Stability: experimental (ADR-0054).
Index ¶
- type Config
- type Store
- func (s *Store) Copy(ctx context.Context, src, dst string) (storage.Object, error)
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) Get(ctx context.Context, key string) (io.ReadCloser, storage.Object, error)
- func (s *Store) Info() storage.Info
- func (s *Store) List(ctx context.Context, opts storage.ListOptions) (storage.Page, error)
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) Put(ctx context.Context, key string, r io.Reader, size int64, ...) (storage.Object, error)
- func (s *Store) SignedURL(ctx context.Context, key, method string, expiry time.Duration) (string, error)
- func (s *Store) Stat(ctx context.Context, key string) (storage.Object, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Driver names the service for operators: s3, spaces, r2 or minio.
Driver string
// Endpoint is the service's host, without a scheme: s3.amazonaws.com,
// nyc3.digitaloceanspaces.com, <account>.r2.cloudflarestorage.com,
// 127.0.0.1:9000 for MinIO.
Endpoint string
Region string
Bucket string
AccessKey string
SecretKey config.Secret
// UseSSL is on for every service but a local MinIO.
UseSSL bool
// PathStyle addresses the bucket in the path (MinIO) rather than the
// host.
PathStyle bool
// PublicURL is where the bucket's objects are reachable when public.
PublicURL string
}
Config connects to a service.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an S3-compatible storage.Store.
func (*Store) Copy ¶
Copy implements storage.Store.
func (*Store) Delete ¶
Delete implements storage.Store.
func (*Store) Get ¶
Get implements storage.Store.
func (*Store) List ¶
List implements storage.Store. The cursor is the last key of the previous page (S3's StartAfter).
func (*Store) Ping ¶
Ping implements storage.Store: the bucket must exist.
func (*Store) Put ¶
func (s *Store) Put(ctx context.Context, key string, r io.Reader, size int64, opts storage.PutOptions) (storage.Object, error)
Put implements storage.Store. size may be -1 when unknown.
Click to show internal directories.
Click to hide internal directories.