gfs3

package
v0.0.0-...-3810ba9 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsS3Config

type AwsS3Config struct {
	AccessKey string `toml:"ak"`
	SecretKey string `toml:"sk"`
	Endpoint  string `toml:"endpoint"`
	Region    string `toml:"region"`
}

type DownloadOption

type DownloadOption func(options *downloadOptions)

func WithExpectedBucketOwner

func WithExpectedBucketOwner(expectedBucketOwner string) DownloadOption

type S3Mgr

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

func NewS3Mgr

func NewS3Mgr(c AwsS3Config) *S3Mgr

func (*S3Mgr) CreateBucket

func (m *S3Mgr) CreateBucket(ctx context.Context, bucket string) error

func (*S3Mgr) DeleteBucket

func (m *S3Mgr) DeleteBucket(ctx context.Context, bucket string) error

func (*S3Mgr) DeleteObjects

func (m *S3Mgr) DeleteObjects(ctx context.Context, bucket string, objKeys []string) error

func (*S3Mgr) Download

func (m *S3Mgr) Download(ctx context.Context, bucket, key string, out io.WriterAt, opts ...DownloadOption) (int64, error)

func (*S3Mgr) ExpireBucket

func (m *S3Mgr) ExpireBucket(ctx context.Context, bucket string, days int64) error

func (*S3Mgr) GetS3Conn

func (m *S3Mgr) GetS3Conn(ctx context.Context) (*s3.S3, error)

func (*S3Mgr) ListObjectKeysPages

func (m *S3Mgr) ListObjectKeysPages(ctx context.Context, bucket string, dir string, pageSize int64) ([][]string, error)

func (*S3Mgr) TruncateDir

func (m *S3Mgr) TruncateDir(ctx context.Context, bucket string, dir string) error

func (*S3Mgr) Upload

func (m *S3Mgr) Upload(ctx context.Context, bucket, key string, file io.Reader, opts ...UploadOption) (string, error)

type UploadOption

type UploadOption func(options *uploadOptions)

func WithACL

func WithACL(acl string) UploadOption

func WithContentDisposition

func WithContentDisposition(contentDisposition string) UploadOption

Jump to

Keyboard shortcuts

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