checking in, tests left

This commit is contained in:
2021-12-23 04:21:21 -05:00
parent 25f9c3c1c9
commit 6c64681bc8
8 changed files with 206 additions and 75 deletions

View File

@@ -34,6 +34,30 @@ func NewPassword(f *Folder, keyName string, recursion *RecurseOpts) (password *P
return
}
// Delete will delete this Password from its parent Folder. You may want to run Folder.UpdatePasswords to update the existing map of Password items.
func (p *Password) Delete() (err error) {
if err = p.folder.RemoveEntry(p.Name); err != nil {
return
}
p = nil
return
}
// SetValue will replace this Password's Password.Value.
func (p *Password) SetValue(newValue string) (err error) {
if _, err = p.folder.WritePassword(p.Name, newValue); err != nil {
return
}
p.Value = newValue
return
}
// Update fetches a Password's Password.Value.
func (p *Password) Update() (err error) {