From adf48aa5b7bd09eb47ec47cfb6c0c43dfdd1886c Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Thu, 25 Mar 2021 23:33:26 +0100 Subject: [PATCH] add some more shortcuts --- internal/db/db.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/db/db.go b/internal/db/db.go index a9e4da6..4e315d2 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -134,6 +134,14 @@ type DB interface { // In case of no entries, a 'no entries' error will be returned GetLastStatusForAccountID(accountID string, status *model.Status) error + // IsUsernameAvailable checks whether a given username is available on our domain. + // Returns an error if the username is already taken, or something went wrong in the db. + IsUsernameAvailable(username string) error + + // IsEmailAvailable checks whether a given email address for a user is available on our domain. + // Returns an error if the email is already associated with an account, or something went wrong in the db. + IsEmailAvailable(email string) error + /* USEFUL CONVERSION FUNCTIONS */