utils

package
v0.0.0-...-8d6a997 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToTar

func AddToTar(tarWriter *tar.Writer, path string) error

func CheckOldFilesInS3

func CheckOldFilesInS3(cfgValues configs.Config, s3Client StorageClient, isExtraClient bool)

func CheckToolIsExist

func CheckToolIsExist(tool string) bool

func CleanupFilesAndTar

func CleanupFilesAndTar(files []string)

func SetStorageClient

func SetStorageClient(cfgValues configs.Config) (StorageClient, StorageClient)

func TarFiles

func TarFiles(backupSource, currentDate, backupDir string, files []string) []string

func UploadToS3

func UploadToS3(cfgValues configs.Config, tarFilename []string, s3Client, extraS3Client StorageClient)

Types

type AWSS3StorageClient

type AWSS3StorageClient struct {
	Client *s3.Client
}

func (*AWSS3StorageClient) ListObjects

func (c *AWSS3StorageClient) ListObjects(cfgValues configs.Config, isExtraClient bool) (interface{}, error)

func (*AWSS3StorageClient) RemoveFileFromS3

func (c *AWSS3StorageClient) RemoveFileFromS3(filename string, cfgValues configs.Config, isExtraClient bool) error

func (*AWSS3StorageClient) UploadFileToS3

func (c *AWSS3StorageClient) UploadFileToS3(filename string, cfgValues configs.Config, dailyPrefix string, isExtraClient bool) error

type AzureStorageClient

type AzureStorageClient struct {
	Client         *azblob.Client
	BlobServiceURL string
}

func (*AzureStorageClient) ListObjects

func (c *AzureStorageClient) ListObjects(cfgValues configs.Config, isExtraClient bool) (interface{}, error)

func (*AzureStorageClient) RemoveFileFromS3

func (c *AzureStorageClient) RemoveFileFromS3(filename string, cfgValues configs.Config, isExtraClient bool) error

func (*AzureStorageClient) UploadFileToS3

func (c *AzureStorageClient) UploadFileToS3(filename string, cfgValues configs.Config, dailyPrefix string, isExtraClient bool) error

type FileMetadata

type FileMetadata struct {
	Name         string
	Size         int64
	LastModified time.Time
}

type MinioStorageClient

type MinioStorageClient struct {
	Client *minio.Client
}

func (*MinioStorageClient) ListObjects

func (c *MinioStorageClient) ListObjects(cfgValues configs.Config, isExtraClient bool) (interface{}, error)

func (*MinioStorageClient) RemoveFileFromS3

func (c *MinioStorageClient) RemoveFileFromS3(filename string, cfgValues configs.Config, isExtraClient bool) error

func (*MinioStorageClient) UploadFileToS3

func (c *MinioStorageClient) UploadFileToS3(filename string, cfgValues configs.Config, dailyPrefix string, isExtraClient bool) error

type OldObject

type OldObject struct {
	Key          string
	LastModified time.Time
	Age          time.Duration
}

type StorageClient

type StorageClient interface {
	ListObjects(cfgValues configs.Config, isExtraClient bool) (interface{}, error)
	RemoveFileFromS3(filename string, cfgValues configs.Config, isExtraClient bool) error
	UploadFileToS3(filename string, cfgValues configs.Config, dailyPrefix string, isExtraClient bool) error
}

func CreateStorageClient

func CreateStorageClient(cfgValues configs.Config, provider string, isExtraClient bool) StorageClient

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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