Export Provider and findFirst (#103)

This commit is contained in:
Aditya Manthramurthy 2018-07-06 01:49:47 -07:00 committed by Harshavardhana
parent 53c7926006
commit c1ee36c19e
2 changed files with 5 additions and 0 deletions

View File

@ -20,9 +20,11 @@ module Network.Minio
(
-- * Credentials
Credentials (..)
, Provider
, fromAWSConfigFile
, fromAWSEnv
, fromMinioEnv
, findFirst
-- * Connecting to object storage
---------------------------------

View File

@ -113,8 +113,11 @@ data Credentials = Credentials { cAccessKey :: Text
, cSecretKey :: Text
} deriving (Eq, Show)
-- | A Provider is an action that may return Credentials
type Provider = IO (Maybe Credentials)
-- | Combines the given list of providers, by calling each one in
-- order until Credentials are found.
findFirst :: [Provider] -> Provider
findFirst [] = return Nothing
findFirst (f:fs) = do c <- f