s3

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFile

func CheckFile(bucket, key string) (map[string]string, error)

func CopyBatch

func CopyBatch(bucket, inputPrefix, outputPrefix string) error

func CreateBucket

func CreateBucket(name string) error

func CreateDefaultBucket

func CreateDefaultBucket() error

func DeleteWithBucket

func DeleteWithBucket(bucket string, s3Keys []string) error

func DeleteWithBucketPrefix

func DeleteWithBucketPrefix(bucket string, prefix string) error

func Download

func Download(key string) (string, error)

func Exist

func Exist(bucket, key string) bool

func GetFileSize

func GetFileSize(svc *s3.S3, bucket string, prefix string) (filesize int64, error error)

func ListDirectories

func ListDirectories(bucket, prefix string) map[string]string

func ListKeys

func ListKeys(bucket, prefix string) (map[string]string, error)

func ListKeysWithCred

func ListKeysWithCred(bucket, prefix string) map[string]string

func UploadBytesWithBucket

func UploadBytesWithBucket(s3Key string, data []byte) (*s3manager.UploadOutput, error)

func UploadFileWithBucket

func UploadFileWithBucket(filePathInput, s3Key string) (*s3manager.UploadOutput, error)

Types

type Config

type Config struct {
	S3AccessKeyId     string           `json:"s3AccessKeyId"`
	S3SecretAccessKey string           `json:"s3SecretAccessKey"`
	S3Region          string           `json:"s3Region"`
	S3Endpoint        string           `json:"s3Endpoint"`
	S3Debug           string           `json:"s3Debug"`
	S3Bucket          string           `json:"s3Bucket"`
	S3LocalDir        string           `json:"s3LocalDir"`
	S3Session         *session.Session `json:"-"`
}

func InitConfig

func InitConfig() *Config

func (*Config) Ping

func (c *Config) Ping() bool

func (*Config) ServerStart

func (c *Config) ServerStart() error

type ProgressWriter

type ProgressWriter struct {
	Written int64
	Writer  io.WriterAt
	Size    int64
}

func (*ProgressWriter) WriteAt

func (pw *ProgressWriter) WriteAt(p []byte, off int64) (int, error)

Jump to

Keyboard shortcuts

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