s3

package
v0.0.0-...-8e82ce0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotFoundAWSErrorCode  = "NotFound"
	NoSuchKeyAWSErrorCode = "NoSuchKey"

	EndpointSetting          = "AWS_ENDPOINT"
	RegionSetting            = "AWS_REGION"
	ForcePathStyleSetting    = "AWS_S3_FORCE_PATH_STYLE"
	AccessKeyIdSetting       = "AWS_ACCESS_KEY_ID"
	AccessKeySetting         = "AWS_ACCESS_KEY"
	SecretAccessKeySetting   = "AWS_SECRET_ACCESS_KEY"
	SecretKeySetting         = "AWS_SECRET_KEY"
	SessionTokenSetting      = "AWS_SESSION_TOKEN"
	SseSetting               = "S3_SSE"
	SseKmsIdSetting          = "S3_SSE_KMS_ID"
	StorageClassSetting      = "S3_STORAGE_CLASS"
	UploadConcurrencySetting = "UPLOAD_CONCURRENCY"

	MaxPartSize           = "S3_MAX_PART_SIZE"
	EndpointSourceSetting = "S3_ENDPOINT_SOURCE"
	EndpointPortSetting   = "S3_ENDPOINT_PORT"
)
View Source
const (
	DefaultMaxPartSize = 20 << 20
)
View Source
const DefaultPort = "443"
View Source
const HTTP = "http"

Variables

Functions

func ConfigureFolder

func ConfigureFolder(prefix string, settings map[string]string) (storage.Folder, error)

func CreateUploaderAPI

func CreateUploaderAPI(svc s3iface.S3API, partsize, concurrency int) s3manageriface.UploaderAPI

CreateUploaderAPI returns an uploader with customizable concurrency and part size.

func NewConfiguringError

func NewConfiguringError(settingName string) storage.Error

func NewFolderError

func NewFolderError(err error, format string, args ...interface{}) storage.Error

Types

type Folder

type Folder struct {
	S3API  s3iface.S3API
	Bucket *string
	Path   string
	// contains filtered or unexported fields
}

func NewFolder

func NewFolder(uploader Uploader, s3API s3iface.S3API, bucket, path string) *Folder

func (*Folder) DeleteObjects

func (folder *Folder) DeleteObjects(objectRelativePaths []string) error

func (*Folder) Exists

func (folder *Folder) Exists(objectRelativePath string) (bool, error)

func (*Folder) GetPath

func (folder *Folder) GetPath() string

func (*Folder) GetSubFolder

func (folder *Folder) GetSubFolder(subFolderRelativePath string) storage.Folder

func (*Folder) ListFolder

func (folder *Folder) ListFolder() (objects []storage.Object, subFolders []storage.Folder, err error)

func (*Folder) PutObject

func (folder *Folder) PutObject(name string, content io.Reader) error

func (*Folder) ReadObject

func (folder *Folder) ReadObject(objectRelativePath string) (io.ReadCloser, error)

type SseKmsIdNotSetError

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

func NewSseKmsIdNotSetError

func NewSseKmsIdNotSetError() SseKmsIdNotSetError

func (SseKmsIdNotSetError) Error

func (err SseKmsIdNotSetError) Error() string

type Uploader

type Uploader struct {
	SSEKMSKeyId  string
	StorageClass string
	// contains filtered or unexported fields
}

func NewUploader

func NewUploader(uploaderAPI s3manageriface.UploaderAPI, serverSideEncryption, sseKmsKeyId, storageClass string) *Uploader

Jump to

Keyboard shortcuts

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