Documentation
¶
Index ¶
- Constants
- Variables
- func ChangePermission(filePath string, mod int)
- func CheckEnvVars(vars []string) error
- func ConvertBytes(bytes uint64) string
- func CopyFile(src, dst string) error
- func CronNextTime(cronExpr string) time.Time
- func DeleteFile(filePath string) error
- func EnvWithDefault(envName string, defaultValue string) string
- func Error(msg string, args ...interface{})
- func Fatal(msg string, args ...interface{})
- func FileExists(filename string) bool
- func FlagGetBool(cmd *cobra.Command, flagName string) bool
- func FlagGetString(cmd *cobra.Command, flagName string) string
- func GetEnv(cmd *cobra.Command, flagName, envName string) string
- func GetEnvVariable(envName, oldEnvName string) string
- func GetIntEnv(envName string) int
- func Info(msg string, args ...interface{})
- func IsDirEmpty(name string) (bool, error)
- func IsValidCronExpression(cronExpr string) bool
- func MakeDir(dirPath string) error
- func MakeDirAll(dirPath string) error
- func NotifyError(error string)
- func NotifySuccess(notificationData *NotificationData)
- func SendEmail(subject, body string) error
- func SetEnv(key, value string)
- func TimeFormat() string
- func Warn(msg string, args ...interface{})
- func WriteToFile(filePath, content string) error
- type ErrorMessage
- type MailConfig
- type NotificationData
Constants ¶
View Source
const BackupExample = "backup --dbname database --disable-compression\n" +
"backup --dbname database --storage s3 --path /custom-path --disable-compression"
View Source
const MainExample = "mysql-bkup backup --dbname database --disable-compression\n" +
"backup --dbname database --storage s3 --path /custom-path\n" +
"restore --dbname database --file db_20231219_022941.sql.gz"
View Source
const RestoreExample = "restore --dbname database --file db_20231219_022941.sql.gz\n" +
"restore --dbname database --storage s3 --path /custom-path --file db_20231219_022941.sql.gz"
Variables ¶
View Source
var DatabaseName = ""
View Source
var Version = ""
Functions ¶
func ChangePermission ¶
func CheckEnvVars ¶
CheckEnvVars checks if all the specified environment variables are set
func ConvertBytes ¶ added in v1.2.25
ConvertBytes converts bytes to a human-readable string with the appropriate unit (bytes, MiB, or GiB).
func CronNextTime ¶ added in v1.2.20
CronNextTime returns cronExpression next time
func DeleteFile ¶
func EnvWithDefault ¶ added in v1.2.20
func GetEnvVariable ¶
func IsDirEmpty ¶
func IsValidCronExpression ¶ added in v1.2.8
IsValidCronExpression verify cronExpression and returns boolean
func NotifyError ¶ added in v1.2.5
func NotifyError(error string)
func NotifySuccess ¶ added in v1.2.5
func NotifySuccess(notificationData *NotificationData)
func TimeFormat ¶ added in v1.2.17
func TimeFormat() string
TimeFormat returns the format of the time
func WriteToFile ¶
Types ¶
type ErrorMessage ¶ added in v1.2.16
type MailConfig ¶ added in v1.2.16
Click to show internal directories.
Click to hide internal directories.