misc

package
v0.0.0-...-c600a59 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YearlyBackupDay  = "1"
	MonthlyBackupDay = "1"
	WeeklyBackupDay  = "0"
	LatestVersionURL = "https://github.com/nixys/nxs-backup/releases/latest/download/nxs-backup"
	VersionURL       = "https://github.com/nixys/nxs-backup/releases/download/v"

	DescFiles            BackupType = "desc_files"
	IncFiles             BackupType = "inc_files"
	Mysql                BackupType = "mysql"
	MysqlXtrabackup      BackupType = "mysql_xtrabackup"
	MariadbBackup        BackupType = "mariadb_backup"
	Postgresql           BackupType = "postgresql"
	PostgresqlBasebackup BackupType = "postgresql_basebackup"
	MongoDB              BackupType = "mongodb"
	Redis                BackupType = "redis"
	External             BackupType = "external"
)

Variables

View Source
var (
	ErrArg            = errors.New("incorrect arguments")
	ErrArgSuccessExit = errors.New("arg success exit")
	ErrConfig         = errors.New("config incorrect")
	ErrExecution      = errors.New("execution finished with errors")
)
View Source
var CPULimit = 0
View Source
var DecadesBackupDays = []string{"1", "11", "21"}

Functions

func AllowedBackupTypesList

func AllowedBackupTypesList() []string

func CheckNewVersionAvailable

func CheckNewVersionAvailable(ver string) (string, string, error)

CheckNewVersionAvailable checks if new version is available

func Contains

func Contains(s []string, str string) bool

Contains checks if a string is present in a slice

func DirNormalize

func DirNormalize(path string) string

DirNormalize normalizes the directory path

func GetDateTimeNow

func GetDateTimeNow(unit string) (res string)

func GetDecadeDaySubdir

func GetDecadeDaySubdir() (decadeDay string)

func GetFileFullPath

func GetFileFullPath(dirPath, baseName, baseExtension, prefix string, gZip bool) (fullPath string)

func GetMessage

func GetMessage(n logger.LogRecord, project, server string) (m string)

GetMessage generates notification message from event log record

func GetOfsPart

func GetOfsPart(regex, target string) string

func PathNormalize

func PathNormalize(path string) (string, error)

PathNormalize normalizes the path

func RandString

func RandString(strLen int64) string

RandString generates random string

Types

type BackupType

type BackupType string

Jump to

Keyboard shortcuts

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