Documentation ¶
Index ¶
- Constants
- func BackupRotation(options Options)
- func Compress(tw *tar.Writer, path string) error
- func CopyDir(src string, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func GenerateSchemaBackup(options Options, db string) error
- func GenerateSingleFileBackup(options Options, db string) error
- func GenerateSingleFileDataBackup(options Options, db string) error
- func GenerateTableBackup(options Options, db string, table Table) error
- func GetDatabaseList(hostname string, bind string, username string, password string, verbosity int) []string
- func GetTotalRowCount(tables []Table) int
- func ListDirs(rootpath string) []string
- func PrintMessage(message string, verbosity int, messageType int)
- func WriteToFile(filePath string, msg string)
- type Options
- type Table
Constants ¶
const ( // Info messages Info = 1 << iota // a == 1 (iota has been reset) // Warning Messages Warning = 1 << iota // b == 2 // Error Messages Error = 1 << iota // c == 4 )
Variables ¶
This section is empty.
Functions ¶
func BackupRotation ¶
func BackupRotation(options Options)
BackupRotation execute a rotation of file, daily,weekly and monthly
func CopyDir ¶
CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.
func CopyFile ¶
CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.
func GenerateSchemaBackup ¶
func GetDatabaseList ¶
func GetDatabaseList(hostname string, bind string, username string, password string, verbosity int) []string
GetDatabaseList retrives list of databases on mysql
func GetTotalRowCount ¶
func PrintMessage ¶
func WriteToFile ¶
WriteToFile create a file and writes a specified msg to it
Types ¶
type Options ¶
type Options struct { HostName string Bind string UserName string Password string Databases []string ExcludedDatabases []string DatabaseRowCountTreshold int TableRowCountTreshold int BatchSize int ForceSplit bool AdditionalMySQLDumpArgs string Verbosity int MySQLDumpPath string OutputDirectory string DefaultsProvidedByUser bool ExecutionStartDate time.Time DailyRotation int WeeklyRotation int MonthlyRotation int }
Options model for commandline arguments
func GetOptions ¶
func GetOptions() *Options
GetOptions creates Options type from Commandline arguments
func NewOptions ¶
func NewOptions(hostname string, bind string, username string, password string, databases string, excludeddatabases string, databasetreshold int, tablethreshold int, batchsize int, forcesplit bool, additionals string, verbosity int, mysqldumppath string, outputDirectory string, defaultsProvidedByUser bool, dailyrotation int, weeklyrotation int, monthlyrotation int) *Options
NewOptions returns a new Options instance.