napkin-runtime-2.0.0
Safe HaskellNone
LanguageGHC2024

Napkin.Run.Metadata.KVStore

Documentation

class (FromJSON payload, ToJSON payload, Ord key) => MetadataPayload key payload | key -> payload where #

Methods

keyText :: key -> Text #

kvReadMany :: (MetadataPayload key payload, MonadIO m, Katip m) => KVS -> [key] -> m (Map key payload) #

kvRead :: (MetadataPayload key payload, MonadIO m, Katip m) => KVS -> key -> m (Maybe payload) #

kvWrite :: (MetadataPayload key payload, MonadIO m, Katip m) => KVS -> key -> payload -> m () #

kvUpdate :: (MetadataPayload key payload, MonadIO m, Katip m) => KVS -> key -> (Maybe payload -> payload) -> m () #

data KVS #

Constructors

KVS 

Fields

type InitKVS (m :: Type -> k) = m (KVS, IO ()) #

withKVS :: (MonadIO m, MonadResource m) => InitKVS m -> (KVS -> m a) -> m a #