diff options
| author | LLLL Colonq <llll@colonq> | 2025-10-23 21:54:06 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2025-10-23 21:54:06 -0400 |
| commit | 9cf01f48f9bf9cb882c2849198d0118fad4b4bf6 (patch) | |
| tree | 2c4fd626f391fdb792fcc80cf0b961e64b91cde3 /fig-web/src/Fig/Web/DB.hs | |
| parent | 6bf32bdad1920aaef196a944cc4313dccbc2eacc (diff) | |
Add HLS streaming API
Diffstat (limited to 'fig-web/src/Fig/Web/DB.hs')
| -rw-r--r-- | fig-web/src/Fig/Web/DB.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fig-web/src/Fig/Web/DB.hs b/fig-web/src/Fig/Web/DB.hs index 9b1728c..0f600c6 100644 --- a/fig-web/src/Fig/Web/DB.hs +++ b/fig-web/src/Fig/Web/DB.hs @@ -96,3 +96,11 @@ rpush :: MonadIO m => DB -> ByteString -> ByteString -> m () rpush (DB c) key val = liftIO $ Redis.runRedis c do _ <- Redis.rpush key [val] pure () + +llen :: MonadIO m => DB -> ByteString -> m (Maybe Integer) +llen (DB c) key = liftIO $ Redis.runRedis c do + hush <$> Redis.llen key + +lindex :: MonadIO m => DB -> ByteString -> Integer -> m (Maybe ByteString) +lindex (DB c) key idx = liftIO $ Redis.runRedis c do + join . hush <$> Redis.lindex key idx |
