packages feed

hw-aws-sqs-conduit (empty) → 0.1.0.0

raw patch · 6 files changed

+115/−0 lines, 6 filesdep +amazonkadep +amazonka-sqsdep +basesetup-changed

Dependencies added: amazonka, amazonka-sqs, base, conduit, hw-aws-sqs-conduit, lens, mtl, text

Files

+ LICENSE view
@@ -0,0 +1,30 @@+Copyright Author name here (c) 2017++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++    * Redistributions of source code must retain the above copyright+      notice, this list of conditions and the following disclaimer.++    * Redistributions in binary form must reproduce the above+      copyright notice, this list of conditions and the following+      disclaimer in the documentation and/or other materials provided+      with the distribution.++    * Neither the name of Author name here nor the names of other+      contributors may be used to endorse or promote products derived+      from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,1 @@+# hw-aws-sqs-conduit
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ hw-aws-sqs-conduit.cabal view
@@ -0,0 +1,50 @@+cabal-version:  >= 1.10++name:                 hw-aws-sqs-conduit+version:              0.1.0.0+synopsis:             AWS SQS conduit+description:          AWS SQS conduit.+category:             Web+homepage:             https://github.com/githubuser/hw-aws-sqs-conduit#readme+bug-reports:          https://github.com/githubuser/hw-aws-sqs-conduit/issues+author:               John Ky+maintainer:           newhoggy@gmail.com+copyright:            2017-2020 John Ky+license:              BSD3+license-file:         LICENSE+build-type:           Simple+extra-source-files:   README.md++source-repository head+  type: git+  location: https://github.com/githubuser/hw-aws-sqs-conduit++library+  exposed-modules:+      HaskellWorks.Aws.Sqs.Conduit+  other-modules:+      Paths_hw_aws_sqs_conduit+  hs-source-dirs:+      src+  build-depends:+      amazonka+    , amazonka-sqs+    , base >=4.7 && <5+    , conduit+    , lens+    , mtl+    , text+  default-language: Haskell2010++test-suite hw-aws-sqs-conduit-test+  type: exitcode-stdio-1.0+  main-is: Spec.hs+  other-modules:+      Paths_hw_aws_sqs_conduit+  hs-source-dirs:+      test+  ghc-options: -threaded -rtsopts -with-rtsopts=-N+  build-depends:+      base+    , hw-aws-sqs-conduit+  default-language: Haskell2010
+ src/HaskellWorks/Aws/Sqs/Conduit.hs view
@@ -0,0 +1,30 @@+module HaskellWorks.Aws.Sqs.Conduit+  ( sqsSink+  , sqsSource+  ) where++import Control.Monad.IO.Class+import Control.Monad.Trans            (lift)+import Data.Conduit+import Data.Text+import Network.AWS                    hiding (await, response)+import Network.AWS.SQS.ReceiveMessage+import Network.AWS.SQS.SendMessage++import qualified Network.AWS as AWS++sqsSink :: MonadAWS m => SendMessage -> Conduit Text m SendMessageResponse+sqsSink sendMessage = do+  maybeM <- await+  case maybeM of+    Just m -> do+      resp <- lift $ send sendMessage+      yield resp+      sqsSink sendMessage+    Nothing -> return ()++sqsSource :: MonadAWS m => ReceiveMessage -> Source m ReceiveMessageResponse+sqsSource receiveMessage = do+  m <- lift $ send receiveMessage+  yield m+  sqsSource receiveMessage
+ test/Spec.hs view
@@ -0,0 +1,2 @@+main :: IO ()+main = putStrLn "Test suite not yet implemented"