api: adding ListPasswords() method to the storage interface.

This commit is contained in:
rithu john
2016-11-16 14:57:27 -08:00
parent 57178fd5f3
commit 19c22807a7
7 changed files with 92 additions and 4 deletions

View File

@@ -192,6 +192,15 @@ func (s *memStorage) ListRefreshTokens() (tokens []storage.RefreshToken, err err
return
}
func (s *memStorage) ListPasswords() (passwords []storage.Password, err error) {
s.tx(func() {
for _, password := range s.passwords {
passwords = append(passwords, password)
}
})
return
}
func (s *memStorage) DeletePassword(email string) (err error) {
email = strings.ToLower(email)
s.tx(func() {