Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Model = Model {
- modelUsers :: !(Map UserImplId UserImpl)
- modelUsersByLogin :: !(Map Login (WithId UserImplId UserImpl))
- modelUserPerms :: !(Map UserPermId UserPerm)
- modelAuthTokens :: !(Map AuthTokenId AuthToken)
- modelUserRestores :: !(Map UserRestoreId UserRestore)
- modelUserSingleUseCodes :: !(Map UserSingleUseCodeId UserSingleUseCode)
- modelAuthUserGroups :: !(Map AuthUserGroupId AuthUserGroup)
- modelAuthUserGroupUsers :: !(Map AuthUserGroupUsersId AuthUserGroupUsers)
- modelAuthUserGroupPerms :: !(Map AuthUserGroupPermsId AuthUserGroupPerms)
- modelNextUserImplId :: !Int64
- modelNextUserPermId :: !Int64
- modelNextAuthTokenId :: !Int64
- modelNextUserRestoreId :: !Int64
- modelNextUserSingleUseCodeId :: !Int64
- modelNextAuthUserGroupId :: !Int64
- modelNextAuthUserGroupUserId :: !Int64
- modelNextAuthUserGroupPermId :: !Int64
- newModel :: Model
- class HasModelRead a where
- class HasModelRead a => HasModelWrite a where
- acidQueries :: [Name]
- makeModelAcidic :: Name -> DecsQ
- asksM :: HasModelRead a => (Model -> b) -> Query a b
- modifyM :: HasModelWrite a => (Model -> Model) -> Update a ()
- getM :: HasModelWrite a => Update a Model
- putM :: HasModelWrite a => Model -> Update a ()
- deriveQueries :: Name -> DecsQ
Documentation
Holds all data for auth server in acid-state container
class HasModelRead a where Source #
The end user should implement this for his global type
Instances
HasModelRead Model Source # | |
class HasModelRead a => HasModelWrite a where Source #
The end user should implement this fot his global type
acidQueries :: [Name] Source #
List of queries of the backend. Can be used if you want additional queries alongside with the auth ones.
Usage:
makeAcidic ''Model (acidQueries ++ [{- your queries herer-}])
makeModelAcidic :: Name -> DecsQ Source #
The end user should inline this TH in his code
deriveQueries :: Name -> DecsQ Source #
Mixin queries to work with auth state