Documentation ¶
Overview ¶
Package cloud manages the backup in a specific cloud.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MultipartUploadLimit ¶
func MultipartUploadLimit(value int64)
MultipartUploadLimit defines the limit where we decide if we will send the file in one shot or if we will use multipart upload strategy. By default we use 100 MB.
func PartSize ¶
func PartSize(value int64)
PartSize the size of each part of the multipart upload except the last, in bytes. The last part can be smaller than this part size. By default we use 4MB.
func WaitJobTime ¶
WaitJobTime is the amount of time that we wait for the job to complete, as it takes some time, we will sleep for a long time before we check again. By default we use 1 minute.
Types ¶
type AWSCloud ¶
type AWSCloud struct { AccountID string VaultName string Glacier glacieriface.GlacierAPI Clock Clock }
AWSCloud is the Amazon solution for storing the backups in the cloud. It uses the Amazon Glacier service, as it allows large files for a small price.
func NewAWSCloud ¶
NewAWSCloud initializes the Amazon cloud object, defining the account ID and vault name that are going to be used in the AWS Glacier service. For more details set the debug flag to receive low level information in the standard output.
func (*AWSCloud) Get ¶
Get retrieves a specific backup file and stores it locally in a file. The filename storing the location of the file is returned.
type AWSIventoryArchiveList ¶
type AWSIventoryArchiveList []struct { ArchiveID string `json:"ArchiveId"` ArchiveDescription string `json:"ArchiveDescription"` CreationDate time.Time `json:"CreationDate"` Size int `json:"Size"` SHA256TreeHash string `json:"SHA256TreeHash"` }
AWSIventoryArchiveList stores the archive information retrieved from AWS Glacier service.
func (AWSIventoryArchiveList) Len ¶
func (a AWSIventoryArchiveList) Len() int
func (AWSIventoryArchiveList) Less ¶
func (a AWSIventoryArchiveList) Less(i, j int) bool
func (AWSIventoryArchiveList) Swap ¶
func (a AWSIventoryArchiveList) Swap(i, j int)
type Backup ¶
type Backup struct { // ID primary key to identify the archive in the cloud. ID string // Time that the archive was created in the cloud. CreatedAt time.Time // Checksum is a SHA256 of the archive content. Checksum string // VaultName is the identifier of the place in the cloud where the archive was // stored. VaultName string }
Backup store all the necessary information of an already uploaded archive.
type Clock ¶
Clock used to retrieve the current time. Useful for mocking in test environments, or if you want you own implementation of clock to be used.
type Cloud ¶
type Cloud interface { // Send uploads the file to the cloud and return the backup archive // information. Send(filename string) (Backup, error) // List retrieves all the uploaded backups information in the cloud. List() ([]Backup, error) // Get retrieves a specific backup file and stores it locally in a file. The // filename storing the location of the file is returned. Get(id string) (filename string, err error) // Remove erase a specific backup from the cloud. Remove(id string) error }
Cloud offers all necessary operations to manage backups in the cloud.