servant-auth-token-leveldb-0.4.2.1: Leveldb backend for servant-auth-token server

Safe HaskellNone
LanguageHaskell2010

Servant.Server.Auth.Token.LevelDB

Synopsis

Documentation

data LevelDBBackendT m a Source #

Monad transformer that implements storage backend

Instances

Monad m => MonadError ServantErr (LevelDBBackendT m) Source # 
MonadBase IO m => MonadBase IO (LevelDBBackendT m) Source # 

Methods

liftBase :: IO α -> LevelDBBackendT m α #

MonadBaseControl IO m => MonadBaseControl IO (LevelDBBackendT m) Source # 

Associated Types

type StM (LevelDBBackendT m :: * -> *) a :: * #

Monad m => Monad (LevelDBBackendT m) Source # 
Functor m => Functor (LevelDBBackendT m) Source # 

Methods

fmap :: (a -> b) -> LevelDBBackendT m a -> LevelDBBackendT m b #

(<$) :: a -> LevelDBBackendT m b -> LevelDBBackendT m a #

Monad m => Applicative (LevelDBBackendT m) Source # 
MonadIO m => MonadIO (LevelDBBackendT m) Source # 

Methods

liftIO :: IO a -> LevelDBBackendT m a #

MonadThrow m => MonadThrow (LevelDBBackendT m) Source # 

Methods

throwM :: Exception e => e -> LevelDBBackendT m a #

MonadCatch m => MonadCatch (LevelDBBackendT m) Source # 

Methods

catch :: Exception e => LevelDBBackendT m a -> (e -> LevelDBBackendT m a) -> LevelDBBackendT m a #

(MonadBase IO m, MonadThrow m, MonadIO m) => MonadResource (LevelDBBackendT m) Source # 
(MonadBase IO m, MonadIO m, MonadThrow m, MonadMask m) => HasStorage (LevelDBBackendT m) Source # 

Methods

getUserImpl :: UserImplId -> LevelDBBackendT m (Maybe UserImpl) #

getUserImplByLogin :: Login -> LevelDBBackendT m (Maybe (WithId UserImplId UserImpl)) #

listUsersPaged :: Page -> PageSize -> LevelDBBackendT m ([WithId UserImplId UserImpl], Word) #

getUserImplPermissions :: UserImplId -> LevelDBBackendT m [WithId UserPermId UserPerm] #

deleteUserPermissions :: UserImplId -> LevelDBBackendT m () #

insertUserPerm :: UserPerm -> LevelDBBackendT m UserPermId #

insertUserImpl :: UserImpl -> LevelDBBackendT m UserImplId #

replaceUserImpl :: UserImplId -> UserImpl -> LevelDBBackendT m () #

deleteUserImpl :: UserImplId -> LevelDBBackendT m () #

hasPerm :: UserImplId -> Permission -> LevelDBBackendT m Bool #

getFirstUserByPerm :: Permission -> LevelDBBackendT m (Maybe (WithId UserImplId UserImpl)) #

selectUserImplGroups :: UserImplId -> LevelDBBackendT m [WithId AuthUserGroupUsersId AuthUserGroupUsers] #

clearUserImplGroups :: UserImplId -> LevelDBBackendT m () #

insertAuthUserGroup :: AuthUserGroup -> LevelDBBackendT m AuthUserGroupId #

insertAuthUserGroupUsers :: AuthUserGroupUsers -> LevelDBBackendT m AuthUserGroupUsersId #

insertAuthUserGroupPerms :: AuthUserGroupPerms -> LevelDBBackendT m AuthUserGroupPermsId #

getAuthUserGroup :: AuthUserGroupId -> LevelDBBackendT m (Maybe AuthUserGroup) #

listAuthUserGroupPermissions :: AuthUserGroupId -> LevelDBBackendT m [WithId AuthUserGroupPermsId AuthUserGroupPerms] #

listAuthUserGroupUsers :: AuthUserGroupId -> LevelDBBackendT m [WithId AuthUserGroupUsersId AuthUserGroupUsers] #

replaceAuthUserGroup :: AuthUserGroupId -> AuthUserGroup -> LevelDBBackendT m () #

clearAuthUserGroupUsers :: AuthUserGroupId -> LevelDBBackendT m () #

clearAuthUserGroupPerms :: AuthUserGroupId -> LevelDBBackendT m () #

deleteAuthUserGroup :: AuthUserGroupId -> LevelDBBackendT m () #

listGroupsPaged :: Page -> PageSize -> LevelDBBackendT m ([WithId AuthUserGroupId AuthUserGroup], Word) #

setAuthUserGroupName :: AuthUserGroupId -> Text -> LevelDBBackendT m () #

setAuthUserGroupParent :: AuthUserGroupId -> Maybe AuthUserGroupId -> LevelDBBackendT m () #

insertSingleUseCode :: UserSingleUseCode -> LevelDBBackendT m UserSingleUseCodeId #

setSingleUseCodeUsed :: UserSingleUseCodeId -> Maybe UTCTime -> LevelDBBackendT m () #

getUnusedCode :: SingleUseCode -> UserImplId -> UTCTime -> LevelDBBackendT m (Maybe (WithId UserSingleUseCodeId UserSingleUseCode)) #

invalidatePermamentCodes :: UserImplId -> UTCTime -> LevelDBBackendT m () #

selectLastRestoreCode :: UserImplId -> UTCTime -> LevelDBBackendT m (Maybe (WithId UserRestoreId UserRestore)) #

insertUserRestore :: UserRestore -> LevelDBBackendT m UserRestoreId #

findRestoreCode :: UserImplId -> RestoreCode -> UTCTime -> LevelDBBackendT m (Maybe (WithId UserRestoreId UserRestore)) #

replaceRestoreCode :: UserRestoreId -> UserRestore -> LevelDBBackendT m () #

findAuthToken :: UserImplId -> UTCTime -> LevelDBBackendT m (Maybe (WithId AuthTokenId AuthToken)) #

findAuthTokenByValue :: SimpleToken -> LevelDBBackendT m (Maybe (WithId AuthTokenId AuthToken)) #

insertAuthToken :: AuthToken -> LevelDBBackendT m AuthTokenId #

replaceAuthToken :: AuthTokenId -> AuthToken -> LevelDBBackendT m () #

Monad m => HasAuthConfig (LevelDBBackendT m) Source # 
Monad m => MonadReader (AuthConfig, LevelDBEnv) (LevelDBBackendT m) Source # 
type StM (LevelDBBackendT m) a Source # 
type StM (LevelDBBackendT m) a

runLevelDBBackendT :: MonadBaseControl IO m => AuthConfig -> LevelDBEnv -> LevelDBBackendT m a -> m (Either ServantErr a) Source #

Execute backend action with given connection pool.

data LevelDBEnv Source #

Holds together db reference and options for read/write and mutex

newLevelDBEnv :: MonadIO m => DB -> ReadOptions -> WriteOptions -> m LevelDBEnv Source #

Make new environment for execution of LevelDB operations