s3

package
v0.0.0-...-474e430 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACLAuthenticatedRead = "authenticated-read"
	ACLPrivate           = "private"
	ACLPublicRead        = "public-read"
	ACLPublicReadWrite   = "public-read-write"
)

Variables

This section is empty.

Functions

func String

func String(v string) *string

Types

type AmazonS3

type AmazonS3 struct {
	// contains filtered or unexported fields
}

wrapped struct for S3

func NewClient

func NewClient() *AmazonS3

Create new AmazonS3 struct

func (*AmazonS3) GetBucket

func (s *AmazonS3) GetBucket(bucket string) *Bucket

get bucket

type Bucket

type Bucket struct {
	// contains filtered or unexported fields
}

struct for bucket

func (*Bucket) AddObject

func (b *Bucket) AddObject(obj *S3Object, path string)

add object to write spool (w/ public read access)

func (*Bucket) AddSecretObject

func (b *Bucket) AddSecretObject(obj *S3Object, path string)

add object to write spool (w/ ACL permission)

func (*Bucket) DeleteObject

func (b *Bucket) DeleteObject(path string) error

delete object of target path

func (*Bucket) GetObjectByte

func (b *Bucket) GetObjectByte(path string) ([]byte, error)

fetch bytes of object from target S3 path

func (*Bucket) GetSecretURL

func (b *Bucket) GetSecretURL(path string) (string, error)

fetch url of target S3 object w/ ACL permission (url expires in 3min)

func (*Bucket) GetSecretURLWithExpire

func (b *Bucket) GetSecretURLWithExpire(path string, expire uint64) (string, error)

fetch url of target S3 object w/ ACL permission (url expires in `expire` value seconds) ** this isn't work **

func (*Bucket) GetURL

func (b *Bucket) GetURL(path string) string

fetch url of target S3 object

func (*Bucket) Put

func (b *Bucket) Put() error

put object to server

type FileBuffer

type FileBuffer struct {
	Buffer bytes.Buffer
	Index  int64
}

wrapped struct for io.ReadSeeker alternative

func NewFileBuffer

func NewFileBuffer(b []byte) *FileBuffer

func (*FileBuffer) Bytes

func (f *FileBuffer) Bytes() []byte

func (*FileBuffer) Close

func (f *FileBuffer) Close() error

func (*FileBuffer) Read

func (f *FileBuffer) Read(p []byte) (int, error)

func (*FileBuffer) Seek

func (f *FileBuffer) Seek(offset int64, whence int) (int64, error)

type S3Object

type S3Object struct {
	// contains filtered or unexported fields
}

struct for S3 upload

func NewS3Object

func NewS3Object(file *os.File) *S3Object

Create new S3Object From File

func NewS3ObjectCopy

func NewS3ObjectCopy(file *os.File) *S3Object

Create new S3Object From File and copy byte data

func NewS3ObjectString

func NewS3ObjectString(str *string) *S3Object

Create new S3Object From string

func (*S3Object) Content

func (o *S3Object) Content() io.ReadSeeker

get content from S3Object

func (*S3Object) FileType

func (o *S3Object) FileType() string

func (*S3Object) SetTypeAsText

func (o *S3Object) SetTypeAsText()

func (*S3Object) Size

func (o *S3Object) Size() int64

func (*S3Object) String

func (o *S3Object) String() string

Jump to

Keyboard shortcuts

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