Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data LogLevel
- type Logger = LogLevel -> Text -> IO ()
- defaultLog :: LogLevel -> Logger
- data Configuration = Configuration {
- timeInfo :: TimeInfo
- credentials :: Credentials
- logger :: Logger
- proxy :: Maybe Proxy
- baseConfiguration :: MonadIO io => io Configuration
- dbgConfiguration :: MonadIO io => io Configuration
- aws :: Transaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> ResourceT IO (Response (ResponseMetadata a) a)
- awsRef :: Transaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> IORef (ResponseMetadata a) -> r -> ResourceT IO a
- pureAws :: Transaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> ResourceT IO a
- memoryAws :: (Transaction r a, AsMemoryResponse a, MonadIO io) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> io (MemoryResponse a)
- simpleAws :: (Transaction r a, AsMemoryResponse a, MonadIO io) => Configuration -> ServiceConfiguration r NormalQuery -> r -> io (MemoryResponse a)
- unsafeAws :: (ResponseConsumer r a, Loggable (ResponseMetadata a), SignQuery r) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> ResourceT IO (Response (ResponseMetadata a) a)
- unsafeAwsRef :: (ResponseConsumer r a, SignQuery r) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> IORef (ResponseMetadata a) -> r -> ResourceT IO a
- awsUri :: (SignQuery request, MonadIO io) => Configuration -> ServiceConfiguration request UriOnlyQuery -> request -> io ByteString
- awsIteratedSource :: IteratedTransaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> Producer (ResourceT IO) (Response (ResponseMetadata a) a)
- awsIteratedSource' :: (Monad m, IteratedTransaction r a) => (r -> m (a, b)) -> r -> Producer m b
- awsIteratedList :: (IteratedTransaction r a, ListResponse a i) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> Producer (ResourceT IO) i
- awsIteratedList' :: (Monad m, IteratedTransaction r b, ListResponse b c) => (r -> m b) -> r -> Producer m c
Logging
The severity of a log message, in rising order.
type Logger = LogLevel -> Text -> IO () Source #
The interface for any logging function. Takes log level and a log message, and can perform an arbitrary IO action.
defaultLog :: LogLevel -> Logger Source #
The default logger defaultLog minLevel
, which prints log messages above level minLevel
to stderr
.
Configuration
data Configuration Source #
The configuration for an AWS request. You can use multiple configurations in parallel, even over the same HTTP connection manager.
Configuration | |
|
baseConfiguration :: MonadIO io => io Configuration Source #
The default configuration, with credentials loaded from environment variable or configuration file
(see loadCredentialsDefault
).
dbgConfiguration :: MonadIO io => io Configuration Source #
Debug configuration, which logs much more verbosely.
Transaction runners
Safe runners
aws :: Transaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> ResourceT IO (Response (ResponseMetadata a) a) Source #
awsRef :: Transaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> IORef (ResponseMetadata a) -> r -> ResourceT IO a Source #
pureAws :: Transaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> ResourceT IO a Source #
memoryAws :: (Transaction r a, AsMemoryResponse a, MonadIO io) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> io (MemoryResponse a) Source #
simpleAws :: (Transaction r a, AsMemoryResponse a, MonadIO io) => Configuration -> ServiceConfiguration r NormalQuery -> r -> io (MemoryResponse a) Source #
Unsafe runners
unsafeAws :: (ResponseConsumer r a, Loggable (ResponseMetadata a), SignQuery r) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> ResourceT IO (Response (ResponseMetadata a) a) Source #
Run an AWS transaction, without enforcing that response and request type form a valid transaction pair.
This is especially useful for debugging and development, you should not have to use it in production.
All errors are caught and wrapped in the Response
value.
Metadata is wrapped in the Response, and also logged at level Info
.
unsafeAwsRef :: (ResponseConsumer r a, SignQuery r) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> IORef (ResponseMetadata a) -> r -> ResourceT IO a Source #
Run an AWS transaction, without enforcing that response and request type form a valid transaction pair.
This is especially useful for debugging and development, you should not have to use it in production.
Errors are not caught, and need to be handled with exception handlers.
Metadata is put in the IORef
, but not logged.
URI runners
awsUri :: (SignQuery request, MonadIO io) => Configuration -> ServiceConfiguration request UriOnlyQuery -> request -> io ByteString Source #
Run a URI-only AWS transaction. Returns a URI that can be sent anywhere. Does not work with all requests.
Usage:
uri <- awsUri cfg request
Iterated runners
awsIteratedSource :: IteratedTransaction r a => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> Producer (ResourceT IO) (Response (ResponseMetadata a) a) Source #
:: (Monad m, IteratedTransaction r a) | |
=> (r -> m (a, b)) | A runner function for executing transactions. |
-> r | An initial request |
-> Producer m b |
A more flexible version of awsIteratedSource
that uses a
user-supplied run function. Useful for embedding AWS functionality
within application specific monadic contexts.
awsIteratedList :: (IteratedTransaction r a, ListResponse a i) => Configuration -> ServiceConfiguration r NormalQuery -> Manager -> r -> Producer (ResourceT IO) i Source #
:: (Monad m, IteratedTransaction r b, ListResponse b c) | |
=> (r -> m b) | A runner function for executing transactions. |
-> r | An initial request |
-> Producer m c |
A more flexible version of awsIteratedList
that uses a
user-supplied run function. Useful for embedding AWS functionality
within application specific monadic contexts.