s3

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// S3 config info filename
	S3_CONF_FILENNAME = "s3.toml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type S3

type S3 struct {
	*s3.S3
}

S3 is a client for Amazon S3.

func New

func New() (*S3, error)

New returns a new S3 client.

func (*S3) CreateBucket

func (svc *S3) CreateBucket(bucketName, acl string) error

Creates a new bucket.

func (*S3) DeleteBucket

func (svc *S3) DeleteBucket(bucketName string) error

func (*S3) GetObject

func (svc *S3) GetObject(bucketName, key, contentType string) (string, error)

Retrieves objects from Amazon S3.

func (*S3) GetObjectPresignedUrl

func (svc *S3) GetObjectPresignedUrl(bucketName, key string, expireTime int64) (string, error)

Gets object returning the object presigned url.

func (*S3) HeadObject

func (svc *S3) HeadObject(bucketName, key string) (bool, error)

The HEAD operation without returning the object itself.

func (*S3) HeadObjectPresignedUrl

func (svc *S3) HeadObjectPresignedUrl(bucketName, key string, expireTime int64) (*url.URL, bool)

The HEAD operation returning the object presigned url.

func (*S3) ListBucket

func (svc *S3) ListBucket() (*s3.ListBucketsOutput, error)

func (*S3) PutObject

func (svc *S3) PutObject(bucketName, key, fileContent, contentType, publicRead string, size, expireTime int64) error

Puts object

func (*S3) PutObjectPresignedUrl

func (svc *S3) PutObjectPresignedUrl(bucketName, key, contentType, publicRead string, size, expireTime int64) (string, error)

Puts object returning the object presigned url.

type S3Conf

type S3Conf struct {
	// S3 access key
	AccessKey string

	// S3 secret key
	Secretkey string

	// S3 region
	Region string

	// S3 endpoint
	Endpoint string
}

S3 config info

func GetS3Conf

func GetS3Conf() S3Conf

Get S3 config info.

Jump to

Keyboard shortcuts

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