client

package
v0.0.0-...-4d97ccf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2017 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package client provides AWS API wrapper functionality.

Index

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 New

func New(region string) Client

New returns an initialized Client.

func (Client) BucketExists

func (c Client) BucketExists(bucket string) (bool, error)

BucketExists returns a bool indicating if the specified bucket exists.

func (Client) DownloadObject

func (c Client) DownloadObject(bucket, key string) (string, error)

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

func (c Client) LsBuckets() ([]string, error)

LsBuckets performs a request to retrieve all buckets, and returns their names.

func (Client) LsObjects

func (c Client) LsObjects(bucket, prefix string) ([]string, error)

LsObjects performs a request to retrieve all objects, and returns their keys.

func (Client) ObjectExists

func (c Client) ObjectExists(bucket, key string) (bool, error)

ObjectExists returns a bool indicating if the specified object exists.

func (Client) PathExists

func (c Client) PathExists(bucket, path string) (bool, error)

PathExists returns a bool indicating if the specified path exists in a given bucket.

func (Client) UploadObject

func (c Client) UploadObject(bucket, key string, file *os.File) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL