storage

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package storage holds 3rd party driver implementations for blob (and potentially other) stores.

E.g. Amazon Simple Storage Service (S3), Google Drive, Google Cloud Storage or Azure Blob Storage.

Index

Constants

View Source
const (

	// AmazonS3Store blob storage for Amazon Simple Storage Service (S3).
	AmazonS3Store BlobStoreType
	// GoogleDriveStore blob storage for Google Drive.
	GoogleDriveStore
	// GoogleCloudStore blob storage for Google Cloud (GCP) Storage Service.
	GoogleCloudStore
	// AzureBlobStore blob storage for Microsoft Azure Blob Storage Service.
	AzureBlobStore

	AmazonS3Str    = "AMAZON_S3"
	GoogleDriveStr = "GOOGLE_DRIVE"
	GoogleCloudStr = "GCP_STORAGE"
	AzureBlobStr   = "MS_AZURE_BLOB"
)

Variables

BlobStoreMap readable name mapping to BlobStoreType.

View Source
var ErrInvalidBlobStorage = errors.New("cloudsync: Invalid blob storage")

ErrInvalidBlobStorage the given blob storage type is invalid.

Functions

func NewBlobStorage

func NewBlobStorage(cfg cloudsync.Config, storageType string) (cloudsync.BlobStorage, error)

NewBlobStorage allocates a new cloudsync.BlobStorage concrete implementation based on given BlobStoreType.

Types

type AmazonS3

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

AmazonS3 Amazon Simple Storage Service (S3) concrete implementation of cloudsync.BlobStorage.

func NewAmazonS3

func NewAmazonS3(c *s3.Client, cfg cloudsync.Config) *AmazonS3

NewAmazonS3 allocates a new AmazonS3 instance ready to perform underlying S3 API actions using cloudsync.BlobStorage API.

func (*AmazonS3) CheckMod

func (a *AmazonS3) CheckMod(ctx context.Context, key string, modTime time.Time, size int64) (bool, error)

func (*AmazonS3) Upload

func (a *AmazonS3) Upload(ctx context.Context, obj cloudsync.Object) error

type BlobStoreType

type BlobStoreType uint8

BlobStoreType a kind of blob storage (Amazon S3, Google Drive, Google Cloud Storage and/or Microsoft Azure Blob Storage).

Jump to

Keyboard shortcuts

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