backup

package
v1.0.1-0...-b7751fa Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BackupTimeFormat - default backup name format
	BackupTimeFormat = "2006-01-02T15-04-05"
)

Variables

View Source
var (
	// ErrUnknownClickhouseDataPath -
	ErrUnknownClickhouseDataPath = errors.New("clickhouse data path is unknown, you can set data_path in config file")
)

Functions

func Clean

func Clean(cfg config.Config) error

Clean - removed all data in shadow folder

func CopyPartHashes

func CopyPartHashes(cfg config.Config, tablePattern string, backupName string) error

CopyPartHashes - Copy data parts hashes by tablePattern

func CreateBackup

func CreateBackup(cfg config.Config, backupName, tablePattern string) error

CreateBackup - create new backup of all tables matched by tablePattern If backupName is empty string will use default backup name

func Download

func Download(cfg config.Config, backupName string) error

func FlashBackData

func FlashBackData(cfg config.Config, backupName string, tablePattern string) error

FlashBackData - restore data for tables matched by tablePattern from backupName

func Flashback

func Flashback(cfg config.Config, backupName string, tablePattern string) error

Flashback - restore tables matched by tablePattern from backupName by restroing only modified parts.

func Freeze

func Freeze(cfg config.Config, tablePattern string) error

Freeze - freeze tables by tablePattern

func GetLocalBackup

func GetLocalBackup(cfg config.Config, backupName string) error

func GetRemoteBackups

func GetRemoteBackups(cfg config.Config) ([]storage.Backup, error)

GetRemoteBackups - get all backups stored on remote storage

func GetTables

func GetTables(cfg config.Config) ([]clickhouse.Table, error)

getTables - get all tables for use by PrintTables and API

func ListLocalBackups

func ListLocalBackups(cfg config.Config) ([]storage.Backup, error)

ListLocalBackups - return slice of all backups stored locally

func NewBackupName

func NewBackupName() string

NewBackupName - return default backup name

func PrintLocalBackups

func PrintLocalBackups(cfg config.Config, format string) error

PrintLocalBackups - print all backups stored locally

func PrintRemoteBackups

func PrintRemoteBackups(cfg config.Config, format string) error

PrintRemoteBackups - print all backups stored on remote storage

func PrintTables

func PrintTables(cfg config.Config) error

PrintTables - print all tables suitable for backup

func RemoveBackupLocal

func RemoveBackupLocal(cfg config.Config, backupName string) error

func RemoveBackupRemote

func RemoveBackupRemote(cfg config.Config, backupName string) error

func RemoveOldBackupsLocal

func RemoveOldBackupsLocal(cfg config.Config) error

func Restore

func Restore(cfg config.Config, backupName string, tablePattern string, schemaOnly bool, dataOnly bool, dropTable bool) error

Restore - restore tables matched by tablePattern from backupName

func RestoreData

func RestoreData(cfg config.Config, backupName string, tablePattern string) error

RestoreData - restore data for tables matched by tablePattern from backupName

func RestoreSchema

func RestoreSchema(cfg config.Config, backupName string, tablePattern string, dropTable bool) error

func Upload

func Upload(cfg config.Config, backupName string, diffFrom string) error

Types

type RestoreTable

type RestoreTable struct {
	Database string
	Table    string
	Query    string
	Path     string
}

RestoreTable - struct to store information needed during restore

type RestoreTables

type RestoreTables []RestoreTable

RestoreTables - slice of RestoreTable

func (RestoreTables) Sort

func (rt RestoreTables) Sort()

Sort - sorting BackupTables slice orderly by name

Jump to

Keyboard shortcuts

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