Documentation ¶
Overview ¶
Package client provides AWS API wrapper functionality.
Index ¶
- type Client
- func (c Client) BucketExists(bucket string) (bool, error)
- func (c Client) DownloadObject(bucket, key string) (string, error)
- func (c Client) LsBuckets() ([]string, error)
- func (c Client) LsObjects(bucket, prefix string) ([]string, error)
- func (c Client) ObjectExists(bucket, key string) (bool, error)
- func (c Client) PathExists(bucket, path string) (bool, error)
- func (c Client) UploadObject(bucket, key string, file *os.File) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines a wrapper for the Amazon S3 API.
func (Client) BucketExists ¶
BucketExists returns a bool indicating if the specified bucket exists.
func (Client) DownloadObject ¶
DownloadObject downloads the specified object from Amazon S3 and returns the name of a local temporary file containing the downloaded object.
Note: It is the responsibility of the caller to clean up the temporary file as necessary.
func (Client) LsBuckets ¶
LsBuckets performs a request to retrieve all buckets, and returns their names.
func (Client) LsObjects ¶
LsObjects performs a request to retrieve all objects, and returns their keys.
func (Client) ObjectExists ¶
ObjectExists returns a bool indicating if the specified object exists.
func (Client) PathExists ¶
PathExists returns a bool indicating if the specified path exists in a given bucket.
func (Client) UploadObject ¶
UploadObject uploads a file to the specified key in an Amazon S3 bucket.
Note: If the key provided is a directory, the file will be stored in the directory with the same name as the original file. If the key exists, it will be overwritten.