Documentation
¶
Index ¶
- Constants
- func CopyFiles(logger *zap.Logger, sourceDir, dstDir string, overwrite bool) error
- type Backup
- type BackupDetails
- type BackupFile
- type BackupLocationDisk
- type BackupRestore
- func (br *BackupRestore) ExecuteImportStorage(apiMap map[string]Backup, sourceDir, fileType string, ignoreEmptyDir bool) error
- func (br *BackupRestore) ExecuteRestore(storage storageTY.Plugin, apiMap map[string]Backup, extractedDir string, ...) error
- func (br *BackupRestore) ExportStorage(exportMap map[string]Backup, transformerFunc DataTransformerFunc, ...) error
- func (br *BackupRestore) ExtractExportedZipFile(...) error
- type DataTransformerFunc
- type OnDemandBackupConfig
Constants ¶
View Source
const ( TypeJSON = "json" TypeYAML = "yaml" LimitPerFile = 50 EntityNameIndexSplit = "__" DateSuffixLayout = "20060102_150405" DefaultStorageExporter = "default_storage_exporter" BackupDetailsFilename = "backup.yaml" // storage backup directory name StorageBackupDirectoryName = "storage" )
global backup/restore constants
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backup ¶
type Backup interface {
Import(data interface{}) error
List(filters []storageTY.Filter, pagination *storageTY.Pagination) (*storageTY.Result, error)
GetEntityInterface() interface{}
}
used to import and export data to database via existing api
type BackupDetails ¶
type BackupDetails struct {
Filename string `json:"filename" yaml:"filename"`
StorageExportType string `json:"storage_export_type" yaml:"storage_export_type"`
CreatedOn time.Time `json:"created_on" yaml:"created_on"`
Version version.Version `json:"version" yaml:"version"`
Directories map[string]string `json:"directories" yaml:"directories"`
}
BackupDetails of a export
type BackupFile ¶
type BackupFile struct {
ID string `json:"id" yaml:"id"`
LocationName string `json:"locationName" yaml:"locationName"`
ProviderType string `json:"providerType" yaml:"providerType"`
Directory string `json:"directory" yaml:"directory"`
FileName string `json:"fileName" yaml:"fileName"`
FileSize int64 `json:"fileSize" yaml:"fileSize"`
FullPath string `json:"fullPath" yaml:"fullPath"`
ModifiedOn time.Time `json:"modifiedOn" yaml:"modifiedOn"`
}
BackupFile details
type BackupLocationDisk ¶
type BackupLocationDisk struct {
TargetDirectory string
}
BackupLocationDisk details
type BackupRestore ¶
type BackupRestore struct {
// contains filtered or unexported fields
}
func (*BackupRestore) ExecuteImportStorage ¶
func (br *BackupRestore) ExecuteImportStorage(apiMap map[string]Backup, sourceDir, fileType string, ignoreEmptyDir bool) error
ExecuteImportStorage update data into database
func (*BackupRestore) ExecuteRestore ¶
func (*BackupRestore) ExportStorage ¶
func (br *BackupRestore) ExportStorage(exportMap map[string]Backup, transformerFunc DataTransformerFunc, targetDir, exportFormat string) error
exports data from database to disk
func (*BackupRestore) ExtractExportedZipFile ¶
func (br *BackupRestore) ExtractExportedZipFile(exportedZipFile, targetDir, restoreReferenceDir, restoreReferenceFilename string) error
type DataTransformerFunc ¶
type DataTransformerFunc func(logger *zap.Logger, entityName string, data interface{}, storageExportType string) (interface{}, error)
data transformer used to modify entity data
type OnDemandBackupConfig ¶
type OnDemandBackupConfig struct {
Prefix string `json:"prefix" yaml:"prefix"`
StorageExportType string `json:"storageExportType" yaml:"storageExportType"`
TargetLocation string `json:"targetLocation" yaml:"targetLocation"`
Handler string `json:"handler" yaml:"handler"`
}
OnDemandBackupConfig config
Click to show internal directories.
Click to hide internal directories.