Safe Haskell | Safe-Infered |
---|
Aws.Aws
- data LogLevel
- type Logger = LogLevel -> Text -> IO ()
- defaultLog :: LogLevel -> Logger
- data Configuration = Configuration {}
- baseConfiguration :: MonadIO io => io Configuration
- dbgConfiguration :: MonadIO io => io Configuration
- aws :: (Transaction r a, MonadIO io) => Configuration -> ServiceConfiguration r -> Manager -> r -> io (Response (ResponseMetadata a) a)
- awsRef :: (Transaction r a, MonadIO io) => Configuration -> ServiceConfiguration r -> Manager -> IORef (ResponseMetadata a) -> r -> io a
- simpleAws :: (Transaction r a, MonadIO io) => Configuration -> ServiceConfiguration r -> r -> io (Response (ResponseMetadata a) a)
- simpleAwsRef :: (Transaction r a, MonadIO io) => Configuration -> ServiceConfiguration r -> IORef (ResponseMetadata a) -> r -> io a
- unsafeAws :: (ResponseConsumer r a, Monoid (ResponseMetadata a), SignQuery r, MonadIO io) => Configuration -> ServiceConfiguration r -> Manager -> r -> io (Response (ResponseMetadata a) a)
- unsafeAwsRef :: (ResponseConsumer r a, Monoid (ResponseMetadata a), SignQuery r, MonadIO io) => Configuration -> ServiceConfiguration r -> Manager -> IORef (ResponseMetadata a) -> r -> io a
- awsUri :: (SignQuery request, MonadIO io) => Configuration -> ServiceConfiguration request -> request -> io ByteString
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 -> LoggerSource
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.
Constructors
Configuration | |
Fields
|
baseConfiguration :: MonadIO io => io ConfigurationSource
The default configuration, with credentials loaded from environment variable or configuration file
(see loadCredentialsDefault
).
dbgConfiguration :: MonadIO io => io ConfigurationSource
Debug configuration, which avoids using HTTPS for some queries. DO NOT USE THIS IN PRODUCTION!
Transaction runners
Safe runners
aws :: (Transaction r a, MonadIO io) => Configuration -> ServiceConfiguration r -> Manager -> r -> io (Response (ResponseMetadata a) a)Source
awsRef :: (Transaction r a, MonadIO io) => Configuration -> ServiceConfiguration r -> Manager -> IORef (ResponseMetadata a) -> r -> io aSource
simpleAws :: (Transaction r a, MonadIO io) => Configuration -> ServiceConfiguration r -> r -> io (Response (ResponseMetadata a) a)Source
simpleAwsRef :: (Transaction r a, MonadIO io) => Configuration -> ServiceConfiguration r -> IORef (ResponseMetadata a) -> r -> io aSource
Run an AWS transaction, without HTTP manager and with metadata returned in an IORef
.
Errors are not caught, and need to be handled with exception handlers.
Usage:
ref <- newIORef mempty;
resp <- simpleAwsRef cfg serviceCfg request
Unsafe runners
unsafeAws :: (ResponseConsumer r a, Monoid (ResponseMetadata a), SignQuery r, MonadIO io) => Configuration -> ServiceConfiguration r -> Manager -> r -> 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.
unsafeAwsRef :: (ResponseConsumer r a, Monoid (ResponseMetadata a), SignQuery r, MonadIO io) => Configuration -> ServiceConfiguration r -> Manager -> IORef (ResponseMetadata a) -> r -> io aSource
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.
URI runners
awsUri :: (SignQuery request, MonadIO io) => Configuration -> ServiceConfiguration request -> request -> io ByteStringSource
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