Documentation ¶
Index ¶
- func BackupDatabase(data *Data)
- func Bot(botToken string) *tb.Bot
- func CheckIfNamedContainerIsRunning(nameInQuestion string) (bool, error)
- func ConnectAndExecute(data *Data, sshData SSHConnectionData, cmd string) (bytes.Buffer, error)
- func ContinuousDBBackups(data *Data)
- func ExecNoShell(command []string) (string, error)
- func ExecuteCmd(command string) (string, error)
- func ExecuteCmds(commands []string)
- func GetConfig(data *Data, sshData SSHConnectionData) (*ssh.ClientConfig, error)
- func GetMainChat(chatID int64) *tb.Chat
- func PerformBaseBackup(data *Data)
- func PerformContinuity(data *Data) error
- func PeriodicDBBackups(data *Data)
- func PublicKeyFile(file string) (ssh.AuthMethod, error)
- func RandString(n int) string
- func RegisterHandlers(b *tb.Bot, data *Data)
- func SFTP(data *Data, sshData SSHConnectionData, remoteFile, localFile string) error
- func TemporaryNginx(data *Data, addressChan chan string, minutes int, ...)
- func VerifySender(data *Data, m *tb.Message) bool
- type Config
- type Data
- type SSHConnectionData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackupDatabase ¶
func BackupDatabase(data *Data)
func ConnectAndExecute ¶
func ContinuousDBBackups ¶
func ContinuousDBBackups(data *Data)
func ExecNoShell ¶
func ExecuteCmd ¶
func ExecuteCmds ¶
func ExecuteCmds(commands []string)
func GetConfig ¶
func GetConfig(data *Data, sshData SSHConnectionData) (*ssh.ClientConfig, error)
func GetMainChat ¶
func PerformBaseBackup ¶
func PerformBaseBackup(data *Data)
func PerformContinuity ¶
func PeriodicDBBackups ¶
func PeriodicDBBackups(data *Data)
func PublicKeyFile ¶
func PublicKeyFile(file string) (ssh.AuthMethod, error)
func RandString ¶
func RegisterHandlers ¶
func TemporaryNginx ¶
Types ¶
type Config ¶
type Config struct { TGBotToken string `env:"PG_VAKT_TG_BOT_TOKEN"` MainChatId int64 `env:"PG_VAKT_TG_CHAT_ID"` IntervalMinutes int `env:"PG_VAKT_INTERVAL_MINUTES"` Continuous bool `env:"PG_VAKT_CONTINUOUS"` ContinuousPath string `env:"PG_VAKT_CONTINUOUS_PATH"` SSHUser string `env:"PG_VAKT_SSH_USER"` SSHHostname string `env:"PG_VAKT_SSH_HOSTNAME"` SSHKeyFilename string `env:"PG_VAKT_SSH_KEY_FILENAME"` ContainerName string `env:"PG_VAKT_CONTAINER_NAME"` Database string `env:"PG_VAKT_DATABASE"` }
type Data ¶
func (*Data) CreateMediaDirIfNotExists ¶
CreateMediaDirIfNotExists creates the directory in default media path. It can accept nested directory path, but all parent directories must exist. Returns full directory path.
type SSHConnectionData ¶
Click to show internal directories.
Click to hide internal directories.