From ceb8421a7b963220a682c274e5e19e1bea9cc9e2 Mon Sep 17 00:00:00 2001 From: IamTheFij Date: Fri, 5 Jan 2024 16:54:58 -0800 Subject: [PATCH] wip --- restic.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/restic.go b/restic.go index 54663eb..5480107 100644 --- a/restic.go +++ b/restic.go @@ -72,6 +72,16 @@ func (NoOpts) ToArgs() []string { return []string{} } +type UnlockOps struckt { + RemoveAll bool `hcl:"RemoveAll,optional"` +} + +func (uo UnlockOpts) ToArgs() (args []string) { + args = maybeAddArgBool(args, "--remove-all", uo.RemoveAll + + return +} + type BackupOpts struct { Exclude []string `hcl:"Exclude,optional"` Include []string `hcl:"Include,optional"` @@ -331,6 +341,12 @@ func (rcmd Restic) Check() error { return err } +func (rcmd Restic) Unlock(unlockOpts UnlockOpts) error { + _, err := rcmd.RunRestic("unlock", unlockOpts) + + return err +} + type Snapshot struct { UID int `json:"uid"` GID int `json:"gid"`