job

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertJobs

func InsertJobs(cron *cr.Cron, cfg *config.Config, kj *kube.KubeJob, botapi *tgbotapi.BotAPI, storageProvider storage.Provider) ([]cr.EntryID, error)

Help func for insert need jobs to cron scheduler

func MakeBackupsInfoMessage

func MakeBackupsInfoMessage(bi []*BackupInfo) string

Help func for make message

Types

type BackupInfo

type BackupInfo struct {
	BackupName       string    `json:"backup_name"`
	Time             time.Time `json:"time"`
	UncompressedSize int64     `json:"uncompressed_size"`
	CompressedSize   int64     `json:"compressed_size"`
}

Helper struct for parse wal-g backups info json

type BackupJob

type BackupJob struct {
	KubeJob        *kube.KubeJob
	Notification   *config.TelegramNotificationBackupConfig
	Exec           string
	TelegramBotApi *tgbotapi.BotAPI
}

BackupJob - struct for manage job, which send commands for make backup

func NewBackupJob

func NewBackupJob(telegramCfg *config.TelegramConfig, kj *kube.KubeJob, botapi *tgbotapi.BotAPI, exec string) *BackupJob

Constructor

func (*BackupJob) Run

func (bj *BackupJob) Run()

Main required method, which implements cron.Job interface

type InfoJob

type InfoJob struct {
	Storage        storage.Provider
	KubeJob        *kube.KubeJob
	Notification   *config.TelegramNotificationInfoConfig
	Exec           string
	TelegramBotApi *tgbotapi.BotAPI
}

InfoJob - struct for manage job, which send notifications of backups and etc

func NewInfoJob

func NewInfoJob(telegramCfg *config.TelegramConfig, kj *kube.KubeJob, botapi *tgbotapi.BotAPI, storageProvider storage.Provider, exec string) *InfoJob

Constructor

func (*InfoJob) Run

func (ij *InfoJob) Run()

Main func for Run this job, implements for cron.Job interface

Jump to

Keyboard shortcuts

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