Documentation
¶
Index ¶
- func Err(err error) error
- type Client
- func (aws *Client) CreateBucket(ctx context.Context, name string, opt ...Opt) (*s3types.Bucket, error)
- func (aws *Client) DeleteBucket(ctx context.Context, name string) error
- func (aws *Client) DeleteObject(ctx context.Context, bucket, key string) error
- func (aws *Client) GetBucket(ctx context.Context, name string) (*s3types.Bucket, error)
- func (aws *Client) GetObject(ctx context.Context, w io.Writer, meta func(url.Values) error, ...) (*s3types.Object, error)
- func (aws *Client) GetObjectMeta(ctx context.Context, bucket, key string) (*s3types.Object, url.Values, error)
- func (aws *Client) ListBuckets(ctx context.Context) ([]s3types.Bucket, error)
- func (aws *Client) ListObjects(ctx context.Context, bucket string, opts ...Opt) ([]s3types.Object, error)
- func (aws *Client) PutObject(ctx context.Context, bucket, key string, r io.Reader, opts ...Opt) (*s3types.Object, error)
- func (aws *Client) Region() string
- func (aws *Client) S3() *s3.Client
- type Opt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateBucket ¶
func (aws *Client) CreateBucket(ctx context.Context, name string, opt ...Opt) (*s3types.Bucket, error)
CreateBucket creates a new S3 bucket
func (*Client) DeleteBucket ¶
DeleteBucket deletes an S3 bucket
func (*Client) DeleteObject ¶
DeleteObject deletes the object with the specified key in the specified bucket.
func (*Client) GetObject ¶
func (aws *Client) GetObject(ctx context.Context, w io.Writer, meta func(url.Values) error, bucket, key string) (*s3types.Object, error)
GetObject returns the metadata and writes the object data with the specified key. If w is nil, no data is written. If meta is nil, the metadata function is not called. The object is returned after the data is written.
func (*Client) GetObjectMeta ¶
func (aws *Client) GetObjectMeta(ctx context.Context, bucket, key string) (*s3types.Object, url.Values, error)
GetObjectMeta returns the object metadata with the specified key in the specified bucket. The object is not downloaded.
func (*Client) ListBuckets ¶
ListBuckets lists all S3 buckets in the account TODO: up to the specified limit.
func (*Client) ListObjects ¶
func (aws *Client) ListObjects(ctx context.Context, bucket string, opts ...Opt) ([]s3types.Object, error)
ListObjects lists all objects in an S3 bucket. Adding WithPrefix() to the options will limit the objects to those with a key that starts with the specified prefix. TODO: up to the specified limit.
func (*Client) PutObject ¶
func (aws *Client) PutObject(ctx context.Context, bucket, key string, r io.Reader, opts ...Opt) (*s3types.Object, error)
PutObject creates or updates an object in the specified bucket with the specified key. The object is created from the specified reader. Content Type and additional metadata can be specified in the options.
type Opt ¶
type Opt func(*opt) error
Opt represents a function that modifies the options