s3

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

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

Go to latest
Published: Nov 21, 2015 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

code for accessing s3.

Index

Constants

View Source
const (
	N = "\n"
)

Variables

This section is empty.

Functions

func PreSignedUrl

func PreSignedUrl(auth aws.Auth, o Object, expiration time.Duration) (string, error)

func SimplePut

func SimplePut(auth aws.Auth, req PutRequest) (err error)

Types

type BasePut

type BasePut struct {
	Object          Object
	ContentType     string
	ContentEncoding string
	ContentMD5      string // md5, hex or base64
}

type Bucket

type Bucket struct {
	Name         string
	CreationDate string
}

type CopyRequest

type CopyRequest struct {
	From, To Object
}

type DeleteRequest

type DeleteRequest struct {
	Object Object
}

type GetRequest

type GetRequest struct {
	Object       Object
	RoundTripper http.RoundTripper
}

type HeadResponse

type HeadResponse struct {
	ETag          string
	ContentType   string
	ContentLength int
	LastModified  time.Time
}

type Interface

type Interface interface {
	Copy(req CopyRequest) error
	Put(req PutRequest) error
	PutObject(req PutObjectRequest) error
	Head(req Object) (*HeadResponse, error)
	Get(req GetRequest) (io.ReadCloser, error)
	GetObject(req GetRequest) ([]byte, error)
	List(req ListRequest) (ListBucketResult, error)
	Delete(req DeleteRequest) error
	Buckets() (*ListAllMyBucketsResult, error)
	MakePublic(bucket string) error
}

func GetDefault

func GetDefault(a aws.Auth) Interface

type ListAllMyBucketsResult

type ListAllMyBucketsResult struct {
	Owner   Owner
	Buckets []Bucket `xml:">Bucket"`
}

type ListBucketResult

type ListBucketResult struct {
	Name, Prefix, Marker, Delimiter string
	MaxKeys                         int64
	IsTruncated                     bool
	Contents                        []ListBucketResultContents
}

type ListBucketResultContents

type ListBucketResultContents struct {
	Key, ETag, StorageClass string `json:",omitempty"`
	Size                    int
	LastModified            time.Time `json:",omitempty"`
}

type ListRequest

type ListRequest struct {
	Bucket  string
	MaxKeys int64
	Marker  string
	Prefix  string
}

type ListedObject

type ListedObject struct {
	ListBucketResultContents
	Bucket string
}

func (ListedObject) Object

func (b ListedObject) Object() Object

type Object

type Object struct {
	Bucket string
	Key    string
}

func (Object) Url

func (o Object) Url() string

type Owner

type Owner struct {
	ID, DisplayName string
}

type PutObjectRequest

type PutObjectRequest struct {
	BasePut
	Data []byte
}

type PutRequest

type PutRequest struct {
	BasePut
	ReaderFact goutil.ReaderFactory
}

type SmartS3

type SmartS3 struct {
	Auth  aws.Auth
	Strat goutil.RetryStrategy
}

func (SmartS3) Buckets

func (s SmartS3) Buckets() (*ListAllMyBucketsResult, error)

func (SmartS3) Copy

func (s SmartS3) Copy(req CopyRequest) error

func (SmartS3) Delete

func (s SmartS3) Delete(req DeleteRequest) error

func (SmartS3) Get

func (s SmartS3) Get(req GetRequest) (io.ReadCloser, error)

func (SmartS3) GetObject

func (s SmartS3) GetObject(req GetRequest) ([]byte, error)

func (SmartS3) Head

func (s SmartS3) Head(req Object) (*HeadResponse, error)

func (SmartS3) List

func (s SmartS3) List(req ListRequest) (ListBucketResult, error)

func (SmartS3) MakePublic

func (s SmartS3) MakePublic(bucket string) error

func (SmartS3) Put

func (s SmartS3) Put(req PutRequest) error

func (SmartS3) PutObject

func (s SmartS3) PutObject(req PutObjectRequest) error

Jump to

Keyboard shortcuts

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