Copyright | (c) 2022 Tim Emiola |
---|---|
License | BSD3 |
Maintainer | Tim Emiola <adetokunbo@emio.la> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
KeyedVals.Handle.Internal
Description
Declares the abstract Handle
Synopsis
- data HandleErr
- = ConnectionClosed
- | Unanticipated !Text
- | NotDecoded !Text
- | BadKey
- | Gone !Key
- data Glob
- mkGlob :: ByteString -> Maybe Glob
- isIn :: ByteString -> Selection -> Bool
- data Selection
- data Handle m = Handle {
- hLoadVal :: !(Key -> m (Either HandleErr (Maybe Val)))
- hSaveVal :: !(Key -> Val -> m (Either HandleErr ()))
- hCountKVs :: !(Key -> m (Either HandleErr Natural))
- hLoadKVs :: !(Key -> m (Either HandleErr ValsByKey))
- hSaveKVs :: !(Key -> ValsByKey -> m (Either HandleErr ()))
- hUpdateKVs :: !(Key -> ValsByKey -> m (Either HandleErr ()))
- hLoadFrom :: !(Key -> Key -> m (Either HandleErr (Maybe Val)))
- hSaveTo :: !(Key -> Key -> Val -> m (Either HandleErr ()))
- hLoadSlice :: !(Key -> Selection -> m (Either HandleErr ValsByKey))
- hDeleteSelected :: !(Selection -> m (Either HandleErr ()))
- hDeleteSelectedKVs :: !(Key -> Selection -> m (Either HandleErr ()))
- hClose :: !(m ())
- type Key = ByteString
- type Val = ByteString
- type ValsByKey = Map Key Val
types used in the Handle
functions
Represents the errors that might arise in Handle
functions
Constructors
ConnectionClosed | |
Unanticipated !Text | |
NotDecoded !Text | |
BadKey | |
Gone !Key |
Instances
Exception HandleErr Source # | |
Defined in KeyedVals.Handle.Internal Methods toException :: HandleErr -> SomeException # fromException :: SomeException -> Maybe HandleErr # displayException :: HandleErr -> String # | |
Show HandleErr Source # | |
Eq HandleErr Source # | |
FromHandleErr HandleErr Source # | |
Defined in KeyedVals.Handle.Codec Methods fromHandleErr :: HandleErr -> HandleErr Source # |
Represents a redis glob use to select keys
isIn :: ByteString -> Selection -> Bool Source #
tests if a ByteString
matches a Selection
Represents ways of restricting the keys used in a ValsByKey
Constructors
Match !Glob | any keys that match the glob pattern |
AllOf !(NonEmpty Key) | any of the specified keys |
the abstract Handle
A handle for accessing the ValsByKey
store.
Constructors
Handle | |
Fields
|
aliases used in the Handle
functions
type Key = ByteString Source #
Represents a key used to store a Val
.
type Val = ByteString Source #
Represents a value stored in the service.