s3

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(ctx context.Context, storage *S3, src string, dest string) (err error)

Download the file to object storage

func ListFiles

func ListFiles(storage *S3, prefix string, recursive bool) (files []string, err error)

ListFiles with specific prefix

func RemoveFiles

func RemoveFiles(target *S3, prefixList []string, dryRun bool)

RemoveFiles will attempt to remove files specified in prefixList in `target` s3 endpoint-bucket recursively. If dryRun is given, the removal will be no op other than a log. Note that this API makes its best attempt to remove given files, if the removal fails, it will log error but the function just continues.

func Upload

func Upload(ctx context.Context, storage *S3, src string, dest string) (err error)

Upload the file to object storage

func Validate

func Validate(s *S3) (err error)

Validate the existence of bucket

Types

type S3

type S3 struct {
	*models.S3Storage
}

func FindDefaultS3

func FindDefaultS3() (*S3, error)

func FindInternalS3

func FindInternalS3() *S3

获取内置的s3

func NewS3StorageFromEncryptedURI

func NewS3StorageFromEncryptedURI(encryptedURI string) (*S3, error)

func NewS3StorageFromURL

func NewS3StorageFromURL(uri string) (*S3, error)

func (*S3) GetEncryptedURL

func (s *S3) GetEncryptedURL() (encrypted string, err error)

func (*S3) GetObjectPath

func (s *S3) GetObjectPath(name string) string

func (*S3) GetSchema

func (s *S3) GetSchema() string

func (*S3) GetURI

func (s *S3) GetURI() string

func (*S3) GetURL

func (s *S3) GetURL() string

func (*S3) Validate

func (s *S3) Validate() error

Jump to

Keyboard shortcuts

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