Documentation
¶
Index ¶
- type Archive
- type ArchiveDetails
- type Backup
- type IncludedFiles
- type LocalBackup
- func (b *LocalBackup) Backup(included *IncludedFiles, prefix string) error
- func (b *LocalBackup) Checksum() ([]byte, error)
- func (b *LocalBackup) Details() *ArchiveDetails
- func (b *LocalBackup) Identifier() string
- func (b *LocalBackup) Path() string
- func (b *LocalBackup) Remove() error
- func (b *LocalBackup) Size() (int64, error)
- type S3Backup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArchiveDetails ¶
func (*ArchiveDetails) ToRequest ¶
func (ad *ArchiveDetails) ToRequest(successful bool) api.BackupRequest
Returns a request object.
type Backup ¶
type Backup interface {
// Returns the UUID of this backup as tracked by the panel instance.
Identifier() string
// Generates a backup in whatever the configured source for the specific
// implementation is.
Backup(*IncludedFiles, string) error
// Returns a SHA256 checksum for the generated backup.
Checksum() ([]byte, error)
// Returns the size of the generated backup.
Size() (int64, error)
// Returns the path to the backup on the machine. This is not always the final
// storage location of the backup, simply the location we're using to store
// it until it is moved to the final spot.
Path() string
// Returns details about the archive.
Details() *ArchiveDetails
}
type IncludedFiles ¶
type LocalBackup ¶
type LocalBackup struct {
// The UUID of this backup object. This must line up with a backup from
// the panel instance.
Uuid string `json:"uuid"`
// An array of files to ignore when generating this backup. This should be
// compatible with a standard .gitignore structure.
IgnoredFiles []string `json:"ignored_files"`
}
func LocateLocal ¶
func LocateLocal(uuid string) (*LocalBackup, os.FileInfo, error)
Locates the backup for a server and returns the local path. This will obviously only work if the backup was created as a local backup.
func (*LocalBackup) Backup ¶
func (b *LocalBackup) Backup(included *IncludedFiles, prefix string) error
Generates a backup of the selected files and pushes it to the defined location for this instance.
func (*LocalBackup) Checksum ¶
func (b *LocalBackup) Checksum() ([]byte, error)
Returns the SHA256 checksum of a backup.
func (*LocalBackup) Details ¶
func (b *LocalBackup) Details() *ArchiveDetails
Returns details of the archive by utilizing two go-routines to get the checksum and the size of the archive.
func (*LocalBackup) Identifier ¶
func (b *LocalBackup) Identifier() string
func (*LocalBackup) Path ¶
func (b *LocalBackup) Path() string
Returns the path for this specific backup.
func (*LocalBackup) Size ¶
func (b *LocalBackup) Size() (int64, error)
Return the size of the generated backup.
type S3Backup ¶
type S3Backup struct {
// The UUID of this backup object. This must line up with a backup from
// the panel instance.
Uuid string
// An array of files to ignore when generating this backup. This should be
// compatible with a standard .gitignore structure.
IgnoredFiles []string
}
func (*S3Backup) Details ¶
func (s *S3Backup) Details() *ArchiveDetails
func (*S3Backup) Identifier ¶
Click to show internal directories.
Click to hide internal directories.