Documentation
¶
Overview ¶
Package s3 is a minimal client for S3-compatible object storage: put, get, list, delete and a write check.
Index ¶
- func IsNotFound(err error) bool
- type Client
- func (c *Client) Check(ctx context.Context, prefix string) error
- func (c *Client) Delete(ctx context.Context, key string) error
- func (c *Client) Get(ctx context.Context, key string) (io.ReadCloser, error)
- func (c *Client) List(ctx context.Context, prefix, token string, limit int) (Listing, error)
- func (c *Client) Open(ctx context.Context, key string) (io.ReadCloser, int64, error)
- func (c *Client) Put(ctx context.Context, key string, body io.Reader, size int64) error
- type Listing
- type Object
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶ added in v0.5.0
IsNotFound reports whether an error from Get or Open means the object doesn't exist.
Types ¶
type Client ¶
type Client struct {
Endpoint string // e.g. https://<account>.r2.cloudflarestorage.com
Region string
Bucket string
AccessKey string
SecretKey string
HTTP *http.Client
}
func (*Client) Check ¶
Check proves the credentials can write to the bucket by putting and removing a small object.
func (*Client) List ¶ added in v0.5.0
List returns one page of what's directly inside prefix, treating "/" as the folder separator.