Documentation ¶
Index ¶
- Constants
- Variables
- func Clean(cfg config.Config) error
- func CopyPartHashes(cfg config.Config, tablePattern string, backupName string) error
- func CreateBackup(cfg config.Config, backupName, tablePattern string) error
- func Download(cfg config.Config, backupName string) error
- func FlashBackData(cfg config.Config, backupName string, tablePattern string) error
- func Flashback(cfg config.Config, backupName string, tablePattern string) error
- func Freeze(cfg config.Config, tablePattern string) error
- func GetLocalBackup(cfg config.Config, backupName string) error
- func GetRemoteBackups(cfg config.Config) ([]storage.Backup, error)
- func GetTables(cfg config.Config) ([]clickhouse.Table, error)
- func ListLocalBackups(cfg config.Config) ([]storage.Backup, error)
- func NewBackupName() string
- func PrintLocalBackups(cfg config.Config, format string) error
- func PrintRemoteBackups(cfg config.Config, format string) error
- func PrintTables(cfg config.Config) error
- func RemoveBackupLocal(cfg config.Config, backupName string) error
- func RemoveBackupRemote(cfg config.Config, backupName string) error
- func RemoveOldBackupsLocal(cfg config.Config) error
- func Restore(cfg config.Config, backupName string, tablePattern string, schemaOnly bool, ...) error
- func RestoreData(cfg config.Config, backupName string, tablePattern string) error
- func RestoreSchema(cfg config.Config, backupName string, tablePattern string, dropTable bool) error
- func Upload(cfg config.Config, backupName string, diffFrom string) error
- type RestoreTable
- type RestoreTables
Constants ¶
const (
// BackupTimeFormat - default backup name format
BackupTimeFormat = "2006-01-02T15-04-05"
)
Variables ¶
var ( // ErrUnknownClickhouseDataPath - ErrUnknownClickhouseDataPath = errors.New("clickhouse data path is unknown, you can set data_path in config file") )
Functions ¶
func CopyPartHashes ¶
CopyPartHashes - Copy data parts hashes by tablePattern
func CreateBackup ¶
CreateBackup - create new backup of all tables matched by tablePattern If backupName is empty string will use default backup name
func FlashBackData ¶
FlashBackData - restore data for tables matched by tablePattern from backupName
func Flashback ¶
Flashback - restore tables matched by tablePattern from backupName by restroing only modified parts.
func GetRemoteBackups ¶
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 ¶
ListLocalBackups - return slice of all backups stored locally
func PrintLocalBackups ¶
PrintLocalBackups - print all backups stored locally
func PrintRemoteBackups ¶
PrintRemoteBackups - print all backups stored on remote storage
func PrintTables ¶
PrintTables - print all tables suitable for backup
func RemoveOldBackupsLocal ¶
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 ¶
RestoreData - restore data for tables matched by tablePattern from backupName
func RestoreSchema ¶
Types ¶
type RestoreTable ¶
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