backup

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src string, dst string) error

Dir copies a whole directory recursively

func CopyFile

func CopyFile(src, dst string) error

File copies a single file from src to dst

Types

type Backup

type Backup struct {
	// contains filtered or unexported fields
}

Backup ...

func NewBackup

func NewBackup(lc fx.Lifecycle, eventBus bus.Bus, cfg *Config) *Backup

NewBackup ...

func (*Backup) ApplyChanges

func (b *Backup) ApplyChanges() (err error)

func (*Backup) ClearStorage

func (b *Backup) ClearStorage(num int64) (err error)

func (*Backup) Delete

func (b *Backup) Delete(name string) (err error)

Delete ...

func (*Backup) List

func (b *Backup) List(ctx context.Context, limit, offset int64, orderBy, s string) (list m.Backups, total int64, err error)

List ...

func (*Backup) New

func (b *Backup) New(scheduler bool) (err error)

New ...

func (*Backup) Restore

func (b *Backup) Restore(name string) (err error)

Restore ...

func (*Backup) RestoreFile

func (b *Backup) RestoreFile(name string) (err error)

RestoreFile ...

func (*Backup) RestoreFromChunks

func (b *Backup) RestoreFromChunks()

func (*Backup) RollbackChanges

func (b *Backup) RollbackChanges() (err error)

func (*Backup) SendFileToTelegram

func (b *Backup) SendFileToTelegram(params events.CommandSendFileToTelegram)

func (*Backup) Shutdown

func (b *Backup) Shutdown(ctx context.Context) (err error)

Shutdown ...

func (*Backup) UploadBackup

func (b *Backup) UploadBackup(ctx context.Context, reader *bufio.Reader, fileName string) (newFile *m.Backup, err error)

UploadBackup ...

type Config

type Config struct {
	Path     string
	Name     string
	User     string
	Password string
	Host     string
	Port     string
}

Config ...

func (Config) String

func (c Config) String() string

String ...

type Local

type Local struct {
	// contains filtered or unexported fields
}

func NewLocal

func NewLocal(cfg *Config) *Local

func (*Local) New

func (l *Local) New(tmpDir string) (err error)

func (*Local) Restore

func (l *Local) Restore(path string) (err error)

Jump to

Keyboard shortcuts

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