lib

package
v0.0.0-...-5f107e4 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackupDatabase

func BackupDatabase(docker *docker.Client, storage *StorageClient, config *BackupConfig) error

Types

type BackupConfig

type BackupConfig struct {
	Name      string
	Strategy  strategies.Strategy
	User      string
	Password  string
	Container *docker.Container
}

func GetBackupConfig

func GetBackupConfig(container *docker.Container) (*BackupConfig, error)

type StorageClient

type StorageClient struct {
	Client    *storage.Client
	Bucket    *storage.BucketHandle
	ProjectID string
}

func CreateStorageClient

func CreateStorageClient(config StorageClientConfig) (*StorageClient, error)

func (*StorageClient) CreateBucket

func (c *StorageClient) CreateBucket(name string, location string, class string) (*storage.BucketHandle, error)

func (*StorageClient) ObjectExists

func (c *StorageClient) ObjectExists(name string) bool

func (*StorageClient) UploadFile

func (c *StorageClient) UploadFile(name string, path string, errCh chan error)

type StorageClientConfig

type StorageClientConfig struct {
	BucketName     string
	BucketLocation string
	BucketClass    string
	ProjectID      string
	PrivateKeyID   string
	PrivateKey     string
	ClientID       string
	ClientEmail    string
}

func (*StorageClientConfig) CreateCredentialsJSON

func (c *StorageClientConfig) CreateCredentialsJSON() ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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