servant-auth-token-acid-0.5.4.0: Acid-state backend for servant-auth-token server

Safe HaskellNone
LanguageHaskell2010

Servant.Server.Auth.Token.Acid

Synopsis

Documentation

data AcidBackendT st m a Source #

Monad transformer that implements storage backend

Instances
Monad m => MonadError ServantErr (AcidBackendT st m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Acid

Methods

throwError :: ServantErr -> AcidBackendT st m a #

catchError :: AcidBackendT st m a -> (ServantErr -> AcidBackendT st m a) -> AcidBackendT st m a #

MonadBase IO m => MonadBase IO (AcidBackendT st m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Acid

Methods

liftBase :: IO α -> AcidBackendT st m α #

MonadBaseControl IO m => MonadBaseControl IO (AcidBackendT st m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Acid

Associated Types

type StM (AcidBackendT st m) a :: * #

Methods

liftBaseWith :: (RunInBase (AcidBackendT st m) IO -> IO a) -> AcidBackendT st m a #

restoreM :: StM (AcidBackendT st m) a -> AcidBackendT st m a #

Monad m => Monad (AcidBackendT st m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Acid

Methods

(>>=) :: AcidBackendT st m a -> (a -> AcidBackendT st m b) -> AcidBackendT st m b #

(>>) :: AcidBackendT st m a -> AcidBackendT st m b -> AcidBackendT st m b #

return :: a -> AcidBackendT st m a #

fail :: String -> AcidBackendT st m a #

Functor m => Functor (AcidBackendT st m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Acid

Methods

fmap :: (a -> b) -> AcidBackendT st m a -> AcidBackendT st m b #

(<$) :: a -> AcidBackendT st m b -> AcidBackendT st m a #

Monad m => Applicative (AcidBackendT st m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Acid

Methods

pure :: a -> AcidBackendT st m a #

(<*>) :: AcidBackendT st m (a -> b) -> AcidBackendT st m a -> AcidBackendT st m b #

liftA2 :: (a -> b -> c) -> AcidBackendT st m a -> AcidBackendT st m b -> AcidBackendT st m c #

(*>) :: AcidBackendT st m a -> AcidBackendT st m b -> AcidBackendT st m b #

(<*) :: AcidBackendT st m a -> AcidBackendT st m b -> AcidBackendT st m a #

MonadIO m => MonadIO (AcidBackendT st m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Acid

Methods

liftIO :: IO a -> AcidBackendT st m a #

Monad m => HasAuthConfig (AcidBackendT st m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Acid

Monad m => MonadReader (AuthConfig, AcidState st) (AcidBackendT st m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Acid

Methods

ask :: AcidBackendT st m (AuthConfig, AcidState st) #

local :: ((AuthConfig, AcidState st) -> (AuthConfig, AcidState st)) -> AcidBackendT st m a -> AcidBackendT st m a #

reader :: ((AuthConfig, AcidState st) -> a) -> AcidBackendT st m a #

type StM (AcidBackendT st m) a Source # 
Instance details

Defined in Servant.Server.Auth.Token.Acid

type StM (AcidBackendT st m) a

runAcidBackendT :: AuthConfig -> AcidState st -> AcidBackendT st m a -> m (Either ServantErr a) Source #

Execute backend action with given connection pool.

deriveAcidHasStorage :: Name -> DecsQ Source #

Derives acid-state HasStorage instance for functions that are generated in makeModelAcidic.

Use this as following: @ instance HasModelRead MyState where askModel = authModel

instance HasModelWrite MyState where putModel m v = m { authModel = v }

makeModelAcidic ''MyState deriveAcidHasStorage @