single db with prefixes, dump/restore, blacklisting on user deletion

This commit is contained in:
ston1th 2018-09-23 23:56:12 +02:00
commit d4971cda89
20 changed files with 264 additions and 163 deletions

11
pkg/db/lockout.go Normal file
View file

@ -0,0 +1,11 @@
package db
const lockoutPrefix = "lockout/"
func (db *DB) lockout(username, created string) error {
return db.store.Set(lockoutPrefix+username+created, nil)
}
func (db *DB) LockedOut(username, created string) bool {
return db.store.Get(lockoutPrefix+username+created, nil) == nil
}