new_storage

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BufferSize - size of ring buffer between stream handlers
	BufferSize = 4 * 1024 * 1024
)

Variables

View Source
var (
	// ErrNotFound is returned when file/object cannot be found
	ErrNotFound = errors.New("key not found")
)

Functions

This section is empty.

Types

type AzureBlob

type AzureBlob struct {
	Container azblob.ContainerURL
	CPK       azblob.ClientProvidedKeyOptions
	Config    *config.AzureBlobConfig
}

AzureBlob - presents methods for manipulate data on Azure

func (*AzureBlob) Connect

func (s *AzureBlob) Connect() error

Connect - connect to Azure

func (*AzureBlob) DeleteFile

func (s *AzureBlob) DeleteFile(key string) error

func (*AzureBlob) GetFileReader

func (s *AzureBlob) GetFileReader(key string) (io.ReadCloser, error)

func (*AzureBlob) Kind

func (s *AzureBlob) Kind() string

func (*AzureBlob) PutFile

func (s *AzureBlob) PutFile(key string, r io.ReadCloser) error

func (*AzureBlob) StatFile

func (s *AzureBlob) StatFile(key string) (RemoteFile, error)

func (*AzureBlob) Walk

func (s *AzureBlob) Walk(azPath string, recursive bool, process func(r RemoteFile) error) error

type Backup

type Backup struct {
	metadata.BackupMetadata
	Legacy        bool
	FileExtension string
}

func GetBackupsToDelete

func GetBackupsToDelete(backups []Backup, keep int) []Backup

type BackupDestination

type BackupDestination struct {
	RemoteStorage
	// contains filtered or unexported fields
}

func NewBackupDestination

func NewBackupDestination(cfg *config.Config) (*BackupDestination, error)

func (*BackupDestination) BackupList

func (bd *BackupDestination) BackupList() ([]Backup, error)

func (*BackupDestination) BackupsToKeep added in v1.0.1

func (bd *BackupDestination) BackupsToKeep() int

func (*BackupDestination) CompressedStreamDownload

func (bd *BackupDestination) CompressedStreamDownload(remotePath string, localPath string) error

func (*BackupDestination) CompressedStreamUpload

func (bd *BackupDestination) CompressedStreamUpload(baseLocalPath string, files []string, remotePath string) error

func (*BackupDestination) DownloadPath

func (bd *BackupDestination) DownloadPath(size int64, remotePath string, localPath string) error

func (*BackupDestination) RemoveBackup

func (bd *BackupDestination) RemoveBackup(backupName string) error

func (*BackupDestination) RemoveOldBackups

func (bd *BackupDestination) RemoveOldBackups(keep int) error

func (*BackupDestination) UploadPath

func (bd *BackupDestination) UploadPath(size int64, baseLocalPath string, files []string, remotePath string) error

type COS

type COS struct {
	Config *config.COSConfig
	Debug  bool
	// contains filtered or unexported fields
}

func (*COS) Connect

func (c *COS) Connect() error

Connect - connect to cos

func (*COS) DeleteFile

func (c *COS) DeleteFile(key string) error

func (*COS) GetFileReader

func (c *COS) GetFileReader(key string) (io.ReadCloser, error)

func (*COS) Kind

func (c *COS) Kind() string

func (*COS) PutFile

func (c *COS) PutFile(key string, r io.ReadCloser) error

func (*COS) StatFile

func (c *COS) StatFile(key string) (RemoteFile, error)

func (*COS) Walk

func (c *COS) Walk(cosPath string, recursuve bool, process func(RemoteFile) error) error

type FTP

type FTP struct {
	Config *config.FTPConfig
	Debug  bool
	// contains filtered or unexported fields
}

func (*FTP) Connect

func (f *FTP) Connect() error

func (*FTP) DeleteFile

func (f *FTP) DeleteFile(key string) error

func (*FTP) GetFileReader

func (f *FTP) GetFileReader(key string) (io.ReadCloser, error)

func (*FTP) Kind

func (f *FTP) Kind() string

func (*FTP) PutFile

func (f *FTP) PutFile(key string, r io.ReadCloser) error

func (*FTP) StatFile

func (f *FTP) StatFile(key string) (RemoteFile, error)

func (*FTP) Walk

func (f *FTP) Walk(ftpPath string, recirsive bool, process func(RemoteFile) error) error

type GCS

type GCS struct {
	Config *config.GCSConfig
	// contains filtered or unexported fields
}

GCS - presents methods for manipulate data on GCS

func (*GCS) Connect

func (gcs *GCS) Connect() error

Connect - connect to GCS

func (*GCS) DeleteFile

func (gcs *GCS) DeleteFile(key string) error

func (*GCS) GetFileReader

func (gcs *GCS) GetFileReader(key string) (io.ReadCloser, error)

func (*GCS) GetFileWriter

func (gcs *GCS) GetFileWriter(key string) io.WriteCloser

func (*GCS) Kind

func (gcs *GCS) Kind() string

func (*GCS) PutFile

func (gcs *GCS) PutFile(key string, r io.ReadCloser) error

func (*GCS) StatFile

func (gcs *GCS) StatFile(key string) (RemoteFile, error)

func (*GCS) Walk

func (gcs *GCS) Walk(gcsPath string, recursive bool, process func(r RemoteFile) error) error

type RemoteFile

type RemoteFile interface {
	Size() int64
	Name() string
	LastModified() time.Time
}

RemoteFile - interface describe file on remote storage

type RemoteStorage

type RemoteStorage interface {
	Kind() string
	StatFile(key string) (RemoteFile, error)
	DeleteFile(key string) error
	Connect() error
	Walk(prefix string, recursive bool, fn func(RemoteFile) error) error
	GetFileReader(key string) (io.ReadCloser, error)
	PutFile(key string, r io.ReadCloser) error
}

RemoteStorage -

type S3

type S3 struct {
	Config     *config.S3Config
	Concurence int
	BufferSize int
	// contains filtered or unexported fields
}

S3 - presents methods for manipulate data on s3

func (*S3) Connect

func (s *S3) Connect() error

Connect - connect to s3

func (*S3) DeleteFile

func (s *S3) DeleteFile(key string) error

func (*S3) GetFileReader

func (s *S3) GetFileReader(key string) (io.ReadCloser, error)

func (*S3) Kind

func (s *S3) Kind() string

func (*S3) PutFile

func (s *S3) PutFile(key string, r io.ReadCloser) error

func (*S3) StatFile

func (s *S3) StatFile(key string) (RemoteFile, error)

func (*S3) Walk

func (s *S3) Walk(s3Path string, recursive bool, process func(r RemoteFile) error) error

Directories

Path Synopsis
forked from github.com/Azure/azure-storage-blob-go/azblob/blob/feature/clientprovidedkey because UploadStreamToBlockBlob does not expose CPK forked from github.com/Azure/azure-storage-blob-go/azblob/blob/feature/clientprovidedkey because UploadStreamToBlockBlob does not expose CPK
forked from github.com/Azure/azure-storage-blob-go/azblob/blob/feature/clientprovidedkey because UploadStreamToBlockBlob does not expose CPK forked from github.com/Azure/azure-storage-blob-go/azblob/blob/feature/clientprovidedkey because UploadStreamToBlockBlob does not expose CPK

Jump to

Keyboard shortcuts

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