Provide a name for additional downloads

This commit is contained in:
2023-11-01 17:05:16 +01:00
parent 396a536b3a
commit 64233c4c63
3 changed files with 27 additions and 23 deletions

View File

@ -17,11 +17,12 @@ import qualified Text.URI as URI
import Crypto.Hash (Digest, MD5)
import SlackBuilder.Trans
import Control.Monad.Catch (MonadThrow)
import Data.Map (Map)
-- | Contains information how a package can be updated.
data Package = Package
{ latest :: Updater
, downloaders :: [Updater]
, downloaders :: Map Text Updater
, category :: Text
, name :: Text
}
@ -79,5 +80,5 @@ renderDownloadWithVersion (DownloadTemplate components) version =
-- | Function used to get the latest version of a source.
data Updater = Updater
{ detectLatest :: SlackBuilderT (Maybe Text)
, getVersion :: Text -> Text -> SlackBuilderT (URI, Digest MD5)
, getVersion :: Text -> Text -> SlackBuilderT Download
}