Documentation
¶
Index ¶
- Constants
- type AmazonGlacierBackupService
- func (agss *AmazonGlacierBackupService) ArtifactFilename(jobName string) string
- func (agss *AmazonGlacierBackupService) BackupLocation() string
- func (agss *AmazonGlacierBackupService) Init() error
- func (agss *AmazonGlacierBackupService) Name() string
- func (agss *AmazonGlacierBackupService) SetConfig(backupConfig *config.BackupConfig)
- func (agss *AmazonGlacierBackupService) StoreFile(pathToFile string) error
- type AmazonS3BackupService
- func (asbs *AmazonS3BackupService) ArtifactFilename(jobName string) string
- func (asbs *AmazonS3BackupService) BackupLocation() string
- func (asbs *AmazonS3BackupService) Init() error
- func (agss *AmazonS3BackupService) Name() string
- func (asbs *AmazonS3BackupService) SetConfig(backupConfig *config.BackupConfig)
- func (asbs *AmazonS3BackupService) StoreFile(pathToFile string) error
- type BackupService
Constants ¶
const ( ERROR_CODE_INVALID_BUCKET_NAME string = "InvalidBucketName" ERROR_CODE_BUCKET_ALREADY_OWNED_BY_YOU string = "BucketAlreadyOwnedByYou" LIFECYCLE_ID string = "frosty-backup-retention-policy" )
const ( BACKUP_NAME_PREFIX = "frosty_" ENVVAR_AWS_ACCESS_KEY_ID = "AWS_ACCESS_KEY_ID" ENVVAR_AWS_SECRET_ACCESS_KEY = "AWS_SECRET_ACCESS_KEY" ENVVAR_AWS_REGION = "AWS_REGION" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmazonGlacierBackupService ¶
type AmazonGlacierBackupService struct { AccessKeyId string SecretAccessKey string Region string AccountId string VaultName string GlacierService *glacier.Glacier }
func (*AmazonGlacierBackupService) ArtifactFilename ¶
func (agss *AmazonGlacierBackupService) ArtifactFilename(jobName string) string
Get the name to be used for the .zip archive without the .zip extension.
func (*AmazonGlacierBackupService) BackupLocation ¶
func (agss *AmazonGlacierBackupService) BackupLocation() string
Get a friendly name for the email template of where this backup was stored. In this case, the name of the Glacier vault.
func (*AmazonGlacierBackupService) Init ¶
func (agss *AmazonGlacierBackupService) Init() error
Initialise anything in the backup service that needs to be created prior to uploading files. In this instance we need to create a vault for the backup to hold any archives.
func (*AmazonGlacierBackupService) Name ¶
func (agss *AmazonGlacierBackupService) Name() string
Return the backup service type this must match the string as used as the JSON property in the frosty backup config.
func (*AmazonGlacierBackupService) SetConfig ¶
func (agss *AmazonGlacierBackupService) SetConfig(backupConfig *config.BackupConfig)
Initialise any variable needed for backups.
func (*AmazonGlacierBackupService) StoreFile ¶
func (agss *AmazonGlacierBackupService) StoreFile(pathToFile string) error
Store the file in pathToFile in Amazon Glacier.
type AmazonS3BackupService ¶
type AmazonS3BackupService struct { AccessKeyId string SecretAccessKey string Region string AccountId string RetentionDays int64 BucketName string Endpoint string UsePathStyleAccess bool S3Service *s3.S3 }
func (*AmazonS3BackupService) ArtifactFilename ¶
func (asbs *AmazonS3BackupService) ArtifactFilename(jobName string) string
Get the name to be used for the .zip archive without the .zip extension.
func (*AmazonS3BackupService) BackupLocation ¶
func (asbs *AmazonS3BackupService) BackupLocation() string
Get a friendly name for the email template of where this backup was stored. In this case, the name of the S3 bucket.
func (*AmazonS3BackupService) Init ¶
func (asbs *AmazonS3BackupService) Init() error
Initialise anything in the backup service that needs to be created prior to uploading files. In this instance we need to create a bucket to store the backups if one does not already exist. This always uses a bucket called "frosty.backups".
func (*AmazonS3BackupService) Name ¶
func (agss *AmazonS3BackupService) Name() string
Return the backup service type this must match the string as used as the JSON property in the frosty backup config.
func (*AmazonS3BackupService) SetConfig ¶
func (asbs *AmazonS3BackupService) SetConfig(backupConfig *config.BackupConfig)
Initialise any variable needed for backups.
func (*AmazonS3BackupService) StoreFile ¶
func (asbs *AmazonS3BackupService) StoreFile(pathToFile string) error
Store the file in pathToFile in the bucket in S3.
type BackupService ¶
type BackupService interface { Name() string SetConfig(backupConfig *config.BackupConfig) Init() error StoreFile(pathToFile string) error ArtifactFilename(jobName string) string BackupLocation() string }
func CurrentBackupService ¶
func CurrentBackupService() *BackupService
func NewBackupService ¶
func NewBackupService(backupConfig *config.BackupConfig) BackupService