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"`