backupUtils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackupDatabase

func BackupDatabase(url, filename string, bType wotoConfig.DatabaseBackupType) error

BackupDatabase backups a database using its url to the specified filename and the type. for seeing which types are currently supported, refer to DatabaseBackupType.IsInvalidType method.

func FormatFileSize

func FormatFileSize(size int64) string

func GenerateCaption

func GenerateCaption(opts *GenerateCaptionOptions) wotoStyle.WStyle

GenerateCaption generates caption for the backup using the specified options.

func GenerateFileNameFromValue

func GenerateFileNameFromValue(value string) string

GenerateFileNameFromOrigin creates a filename from the origin, in "VALUE-backup-2022-5-16--15-30-59" format.

func ZipSource

func ZipSource(source, target string) error

ZipSource converts a source file/directory to the destination zip file.

Types

type GenerateCaptionOptions

type GenerateCaptionOptions struct {
	ConfigName     string
	BackupInitType string
	InitiatedBy    string
	UserId         int64
	DateTime       time.Time
	FileSize       string
	BackupFormat   string
}

Jump to

Keyboard shortcuts

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