Export Provider and findFirst (#103)
This commit is contained in:
parent
53c7926006
commit
c1ee36c19e
@ -20,9 +20,11 @@ module Network.Minio
|
||||
(
|
||||
-- * Credentials
|
||||
Credentials (..)
|
||||
, Provider
|
||||
, fromAWSConfigFile
|
||||
, fromAWSEnv
|
||||
, fromMinioEnv
|
||||
, findFirst
|
||||
|
||||
-- * Connecting to object storage
|
||||
---------------------------------
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user