summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/ResourceProvider.hs
blob: 94dda5bc095d487cbbcf2d4691676b5f5db2b769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- | This module provides an API for resource providers. Resource providers
-- allow Hakyll to get content from resources; the type of resource depends on
-- the concrete instance.
--
module Hakyll.Core.ResourceProvider
    ( ResourceProvider (..)
    ) where

import Hakyll.Core.Identifier

import qualified Data.ByteString.Lazy as LB

-- | A value responsible for retrieving and listing resources
--
data ResourceProvider = ResourceProvider
    { -- | A list of all resources this provider is able to provide
      resourceList           :: [Identifier]
    , -- | Retrieve a certain resource as string
      resourceString         :: Identifier -> IO String
    , -- | Retrieve a certain resource as lazy bytestring
      resourceLazyByteString :: Identifier -> IO LB.ByteString
    }