storage

package
v0.0.0-...-be912e8 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DummyRegion = "my-duck-server"
	HTTPPrefix  = "http://"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	S3Client *s3.Client
}

func NewBucket

func NewBucket(config *aws.Config) *Bucket

func (*Bucket) DownloadFile

func (basics *Bucket) DownloadFile(ctx context.Context, bucketName string, objectKey string, fileName string) (*int64, error)

func (*Bucket) UploadFile

func (basics *Bucket) UploadFile(ctx context.Context, bucketName string, objectKey string, fileName string) (*int64, error)

type ObjectStorageConfig

type ObjectStorageConfig struct {
	Provider        string
	Endpoint        string
	Region          string
	AccessKeyId     string
	SecretAccessKey string
}

func ConstructStorageConfig

func ConstructStorageConfig(remoteUri, endpoint, accessKeyId, secretAccessKey string) (*ObjectStorageConfig, string, error)

func (*ObjectStorageConfig) DownloadFile

func (storageConfig *ObjectStorageConfig) DownloadFile(remotePath, localDir, localFile string) (string, error)

DownloadFile downloads a file from the remote storage to the local storage.

func (*ObjectStorageConfig) UploadFile

func (storageConfig *ObjectStorageConfig) UploadFile(localDir, localFile, remotePath string) (string, error)

Jump to

Keyboard shortcuts

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