From 9cf01f48f9bf9cb882c2849198d0118fad4b4bf6 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Thu, 23 Oct 2025 21:54:06 -0400 Subject: Add HLS streaming API --- fig-web/src/Fig/Web/DB.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fig-web/src/Fig/Web/DB.hs') 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 -- cgit v1.2.3