s3

package
v0.0.0-...-3d72318 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2014 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	S3_API_VERSION = "2006-03-01"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Name         string
	CreationDate string
}

type Buckets

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

type DeleteBucketReq

type DeleteBucketReq struct {
	S3Req
	BucketName string
}

DELETE Bucket

func (*DeleteBucketReq) Init

func (this *DeleteBucketReq) Init() *DeleteBucketReq

type DeleteBucketResp

type DeleteBucketResp struct {
	S3Resp
}

func (*DeleteBucketResp) Init

type Error

type Error struct {
	Code      string `xml`
	Message   string `xml`
	RequestId string `xml`
	Resource  string `xml`
}

*

S3 error handle: http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html

func (*Error) Error

func (this *Error) Error() string

type ExistBucketReq

type ExistBucketReq struct {
	S3Req
	BucketName string
}

HEAD Bucket

func (*ExistBucketReq) Init

func (this *ExistBucketReq) Init() *ExistBucketReq

type ExistBucketResp

type ExistBucketResp struct {
	S3Resp
	Exists bool
}

func (*ExistBucketResp) Init

func (this *ExistBucketResp) Init(req *ExistBucketReq, resp *http.Response) (*ExistBucketResp, error)

type GetServiceReq

type GetServiceReq struct {
	S3Req
}

doc: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTServiceGET.html

func (*GetServiceReq) Init

func (this *GetServiceReq) Init() *GetServiceReq

type GetServiceResp

type GetServiceResp struct {
	S3Resp `xml:"-"`

	Owner   Owner   `xml`
	Buckets Buckets `xml`
}

func (*GetServiceResp) Init

func (this *GetServiceResp) Init(req *GetServiceReq, resp *http.Response) (*GetServiceResp, error)

type NewBucketReq

type NewBucketReq struct {
	S3Req
	BucketName string
}

=================================================== NewBucketReq ref: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUT.html PUT Bucket

func (*NewBucketReq) Init

func (this *NewBucketReq) Init() *NewBucketReq

type NewBucketResp

type NewBucketResp struct {
	S3Resp
}

func (*NewBucketResp) Init

func (this *NewBucketResp) Init(req *NewBucketReq, resp *http.Response) (*NewBucketResp, error)

type Owner

type Owner struct {
	ID          string
	DisplayName string
}

type S3

type S3 struct {
	common.AWSService
}

*

S3 doesn't support virtual hosted style, use path style always.
Ref: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

func NewS3

func NewS3(cred *common.Credentials) (*S3, error)

func (*S3) DeleteBucket

func (this *S3) DeleteBucket(req *DeleteBucketReq) (*DeleteBucketResp, error)

func (*S3) ExistBucket

func (this *S3) ExistBucket(req *ExistBucketReq) (*ExistBucketResp, error)

func (*S3) GetService

func (this *S3) GetService(req *GetServiceReq) (*GetServiceResp, error)

func (*S3) Init

func (this *S3) Init(cred *common.Credentials) (*S3, error)

func (*S3) NewBucket

func (this *S3) NewBucket(req *NewBucketReq) (*NewBucketResp, error)

type S3Req

type S3Req struct {
	common.AWSRequest
}

type S3Resp

type S3Resp struct {
	common.AWSResponse
	Error *Error // response error code from server
}

*

S3 base type, handle error code.

func (*S3Resp) Init

func (this *S3Resp) Init(req *S3Req, resp *http.Response) (*S3Resp, error)

Jump to

Keyboard shortcuts

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