backup

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBackupFile

func CreateBackupFile(dbConn *mongo.Connection, masterKey string) (*os.File, error)

CreateBackupFile creates a backup file from the database contents

YOU NEED TO CLOSE THE RETURNED FILE

func Restore

func Restore(dbConn db.Connection, backupFile string, options StartScheduleOptions)

Restore restores a s3 backup to the mongodb database

func StartsSchedule

func StartsSchedule(dbConn db.Connection, options StartScheduleOptions, forceBackup bool)

StartsSchedule starts the cron job for creating the backups The backupMasterKey is used to encrypt the backup files generated

Types

type StartScheduleOptions

type StartScheduleOptions struct {
	// The key used to encrypt / decrypt the backup files
	BackupEncryptionKey string

	// S3 connection options
	S3Endpoint        string
	S3AccessKeyID     string
	S3SecretAccessKey string
	S3Bucket          string
	S3UseSSL          bool
}

StartScheduleOptions are the options required to run StartsSchedule All fields are required to start the backup schedule

func StartScheduleOptionsFromEnv

func StartScheduleOptionsFromEnv() StartScheduleOptions

StartScheduleOptionsFromEnv creates the StartScheduleOptions from the environment variables

Jump to

Keyboard shortcuts

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