backupPlugin

package
v0.0.0-...-85f0429 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPathOrUrlSet = errors.New("the section doesn't have any path or url set")
)

Functions

func LoadAllHandlers

func LoadAllHandlers(manager *entryManager.EntryManager)

Types

type BackupScheduleContainer

type BackupScheduleContainer struct {
	// DatabaseConfig is the config section of the target db belonging to
	// this container.
	DatabaseConfig *wotoConfig.ValueSection

	// LastBackupDate is the date of the last time we got backup from this db.
	LastBackupDate time.Time

	// BackupInterval is the interval that we will get backup.
	BackupInterval time.Duration

	// ChatIDs field specifies the global log channels that we have
	// to send the backup to.
	ChatIDs []int64
	// contains filtered or unexported fields
}

func GetContainerByName

func GetContainerByName(name string) *BackupScheduleContainer

func (*BackupScheduleContainer) GetBackupType

func (c *BackupScheduleContainer) GetBackupType() string

func (*BackupScheduleContainer) GetName

func (c *BackupScheduleContainer) GetName() string

func (*BackupScheduleContainer) GetStrUniqueId

func (c *BackupScheduleContainer) GetStrUniqueId() string

func (*BackupScheduleContainer) IsWithin

func (m *BackupScheduleContainer) IsWithin(d time.Duration) bool

func (*BackupScheduleContainer) NeedsImmediateBackup

func (c *BackupScheduleContainer) NeedsImmediateBackup() bool

func (*BackupScheduleContainer) ParseAsMd

func (c *BackupScheduleContainer) ParseAsMd() wotoStyle.WStyle

func (*BackupScheduleContainer) RemainingTime

func (m *BackupScheduleContainer) RemainingTime() time.Duration

func (*BackupScheduleContainer) RemainingTimeStr

func (m *BackupScheduleContainer) RemainingTimeStr() string

func (*BackupScheduleContainer) RunBackup

func (c *BackupScheduleContainer) RunBackup()

func (*BackupScheduleContainer) UploadFileToChats

func (m *BackupScheduleContainer) UploadFileToChats(filename string, opts *em.UploadDocumentToChatsOptions) error

type BackupScheduleManager

type BackupScheduleManager struct {

	// ChatIDs field specifies the global log channels that we have
	// to send the backup to.
	ChatIDs []int64
	// contains filtered or unexported fields
}

func (*BackupScheduleManager) FormatInterval

func (m *BackupScheduleManager) FormatInterval() string

FormatInterval method will convert the time interval with this format: "1 day, 2 hours, 3 minutes, 4 seconds" (it will omit the smaller units if they are 0)

func (*BackupScheduleManager) GetContainerByName

func (m *BackupScheduleManager) GetContainerByName(name string) *BackupScheduleContainer

func (*BackupScheduleManager) PrepareBackupInfo

func (m *BackupScheduleManager) PrepareBackupInfo(currentContainers []*BackupScheduleContainer)

func (*BackupScheduleManager) RunChecking

func (m *BackupScheduleManager) RunChecking()

Jump to

Keyboard shortcuts

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