s3

package
v0.0.0-...-db1d7af Latest Latest
Warning

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

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

Documentation

Overview

Package s3 contains a very simple client for the Amazon Simple Storage Service, also known as Amazon S3. Only the most basic of operations are supported.

See here for more info:

http://aws.amazon.com/s3/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket interface {
	// Retrieve data for the object with the given key.
	GetObject(key string) (data []byte, err error)

	// Retrieve headr information for the object with the given key.
	GetHeader(key string) (header sys_http.Header, err error)

	// Store the supplied data with the given key, overwriting any previous
	// version. The object is created with the default ACL of "private".
	StoreObject(key string, data []byte) error

	// Delete the object with the supplied key.
	DeleteObject(key string) error

	// Stream the supplied data with the given key, overwriting any previous
	// version. The object is created with the default ACL of "private".
	Put(key string, data io.ReadSeeker) error

	// Return an ordered set of contiguous object keys in the bucket that are
	// strictly greater than prevKey (or at the beginning of the range if prevKey
	// is empty). It is guaranteed that as some time during the request there
	// were no keys greater than prevKey and less than the first key returned.
	//
	// There may be more keys beyond the last key returned. If no keys are
	// returned (and the error is nil), it is guaranteed that at some time during
	// the request there were the bucket contained no keys in (prevKey, inf).
	//
	// Using this interface you may list all keys in a bucket by starting with
	// the empty string for prevKey (since the empty string is not itself a legal
	// key) and then repeatedly calling again with the last key returned by the
	// previous call.
	//
	// prevKey must be a valid key, with the sole exception that it is allowed to
	// be the empty string.
	ListKeys(prevKey string) (keys []string, err error)
}

Bucket represents an S3 bucket, which is a collection of objects keyed on Unicode strings.

Keys must be non-empty sequences of Unicode characters whose UTF-8 encoding is no more than 1024 bytes long. Because S3 returns "list bucket" responses as XML 1.0 documents, keys must contain no character that is not a legal character as defined by Section 2.2 of the XML 1.0 spec.

See here for more info:

http://goo.gl/Nd63t
http://goo.gl/csem8

func OpenBucket

func OpenBucket(name string, region Region, key aws.AccessKey) (Bucket, error)

OpenBucket returns a Bucket tied to a given name in a given region. You must have previously created the bucket in the region, and the supplied access key must have access to it.

To easily create a bucket, use the AWS Console:

https://console.aws.amazon.com/s3/

type Region

type Region string

Region represents a regional endpoint to S3. Resources created within one region are entirely independent of those created in others. You should use one of the region constants defined by this package when referring to regions.

See here for more info:

http://goo.gl/FhIRw
const (
	RegionUsStandard           Region = "s3.amazonaws.com"
	RegionUsWestOregon         Region = "s3-us-west-2.amazonaws.com"
	RegionUsWestNorCal         Region = "s3-us-west-1.amazonaws.com"
	RegionEuIreland            Region = "s3-eu-west-1.amazonaws.com"
	RegionApacSingapore        Region = "s3-ap-southeast-1.amazonaws.com"
	RegionApacSydney           Region = "s3-ap-southeast-2.amazonaws.com"
	RegionApacTokyo            Region = "s3-ap-northeast-1.amazonaws.com"
	RegionSouthAmericaSaoPaulo Region = "s3-sa-east-1.amazonaws.com"
)

Directories

Path Synopsis
Package auth is an implementation detail.
Package auth is an implementation detail.
Package http is an implementation detail.
Package http is an implementation detail.
tools

Jump to

Keyboard shortcuts

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