Documentation ¶
Index ¶
- Constants
- func BackupCommandByTag(profile *param.Profile, ...) ([]string, error)
- func CheckIfRepoIsReachable(ctx context.Context, profile *param.Profile, artifactPrefix string, ...) error
- func DoesRepoExist(output string) bool
- func ForgetCommandByID(profile *param.Profile, repository, id, encryptionKey string, insecureTLS bool) ([]string, error)
- func GeneratePassword() string
- func GetOrCreateRepository(ctx context.Context, cli kubernetes.Interface, ...) error
- func InitCommand(profile *param.Profile, repository, encryptionKey string, insecureTLS bool) ([]string, error)
- func IsPasswordIncorrect(output string) bool
- func LatestSnapshotsCommand(profile *param.Profile, repository, encryptionKey string, insecureTLS bool) ([]string, error)
- func ParseResticSizeStringBytes(sizeStr string) int64
- func PruneCommand(profile *param.Profile, repository, encryptionKey string, insecureTLS bool) ([]string, error)
- func RestoreCommandByID(profile *param.Profile, repository, id, restorePath, encryptionKey string, ...) ([]string, error)
- func RestoreCommandByTag(profile *param.Profile, repository, tag, restorePath, encryptionKey string, ...) ([]string, error)
- func SnapshotIDFromBackupLog(output string) string
- func SnapshotIDFromSnapshotLog(output string) (string, error)
- func SnapshotStatsFromBackupLog(output string) (fileCount string, backupSize string, phySize string)
- func SnapshotStatsFromStatsLog(output string) (string, string, string)
- func SnapshotStatsModeFromStatsLog(output string) string
- func SnapshotsCommand(profile *param.Profile, repository, encryptionKey string) ([]string, error)
- func SnapshotsCommandByTag(profile *param.Profile, repository, tag, encryptionKey string, ...) ([]string, error)
- func SpaceFreedFromPruneLog(output string) string
- func StatsCommandByID(profile *param.Profile, repository, id, mode, encryptionKey string) ([]string, error)
Constants ¶
const ( PasswordIncorrect = "Password is incorrect" RepoDoesNotExist = "Repo does not exist" )
const ( ResticPassword = "RESTIC_PASSWORD" ResticRepository = "RESTIC_REPOSITORY" ResticCommand = "restic" )
Variables ¶
This section is empty.
Functions ¶
func BackupCommandByTag ¶
func BackupCommandByTag(profile *param.Profile, repository, backupTag, includePath, encryptionKey string, insecureTLS bool) ([]string, error)
BackupCommandByTag returns restic backup command with tag
func CheckIfRepoIsReachable ¶
func CheckIfRepoIsReachable( ctx context.Context, profile *param.Profile, artifactPrefix string, encryptionKey string, insecureTLS bool, cli kubernetes.Interface, namespace string, pod string, container string, ) error
CheckIfRepoIsReachable checks if repo can be reached by trying to list snapshots
func DoesRepoExist ¶
DoesRepoExist checks if repo exists from Snapshot Command log
func ForgetCommandByID ¶
func ForgetCommandByID(profile *param.Profile, repository, id, encryptionKey string, insecureTLS bool) ([]string, error)
ForgetCommandByID returns restic forget command
func GetOrCreateRepository ¶
func GetOrCreateRepository( ctx context.Context, cli kubernetes.Interface, namespace, pod, container, artifactPrefix, encryptionKey string, insecureTLS bool, profile *param.Profile, ) error
GetOrCreateRepository will check if the repository already exists and initialize one if not
func InitCommand ¶
func InitCommand(profile *param.Profile, repository, encryptionKey string, insecureTLS bool) ([]string, error)
InitCommand returns restic init command
func IsPasswordIncorrect ¶
IsPasswordIncorrect checks if password was wrong from Snapshot Command log
func LatestSnapshotsCommand ¶
func LatestSnapshotsCommand(profile *param.Profile, repository, encryptionKey string, insecureTLS bool) ([]string, error)
LatestSnapshotsCommand returns restic snapshots command for last snapshots
func ParseResticSizeStringBytes ¶
ParseResticSizeStringBytes parses size strings as formatted by restic to a int64 number of bytes
func PruneCommand ¶
func PruneCommand(profile *param.Profile, repository, encryptionKey string, insecureTLS bool) ([]string, error)
PruneCommand returns restic prune command
func RestoreCommandByID ¶
func RestoreCommandByID(profile *param.Profile, repository, id, restorePath, encryptionKey string, insecureTLS bool) ([]string, error)
RestoreCommandByID returns restic restore command with snapshotID as the identifier
func RestoreCommandByTag ¶
func RestoreCommandByTag(profile *param.Profile, repository, tag, restorePath, encryptionKey string, insecureTLS bool) ([]string, error)
RestoreCommandByTag returns restic restore command with tag as the identifier
func SnapshotIDFromBackupLog ¶
SnapshotIDFromBackupLog gets the SnapshotID from Backup Command log
func SnapshotIDFromSnapshotLog ¶
SnapshotIDFromSnapshotLog gets the SnapshotID from Snapshot Command log
func SnapshotStatsFromBackupLog ¶
func SnapshotStatsFromBackupLog(output string) (fileCount string, backupSize string, phySize string)
SnapshotStatsFromBackupLog gets the Snapshot file count and size from Backup Command log
func SnapshotStatsFromStatsLog ¶
SnapshotStatsFromStatsLog gets the Snapshot Stats from Stats Command log
func SnapshotStatsModeFromStatsLog ¶
SnapshotStatsModeFromStatsLog gets the Stats mode from Stats Command log
func SnapshotsCommand ¶
SnapshotsCommand returns restic snapshots command
func SnapshotsCommandByTag ¶
func SnapshotsCommandByTag(profile *param.Profile, repository, tag, encryptionKey string, insecureTLS bool) ([]string, error)
SnapshotsCommandByTag returns restic snapshots command
func SpaceFreedFromPruneLog ¶
SpaceFreedFromPruneLog gets the space freed from the prune log output For reference, here is the logging command from restic codebase:
Verbosef("will delete %d packs and rewrite %d packs, this frees %s\n", len(removePacks), len(rewritePacks), formatBytes(uint64(removeBytes)))
Types ¶
This section is empty.