Update examples to use stackage version used by library (#78)

This commit is contained in:
Aditya Manthramurthy 2017-11-16 10:58:31 -08:00 committed by GitHub
parent 33a27323f3
commit 3ef237e4d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 60 additions and 59 deletions

View File

@ -44,7 +44,7 @@ stack haddock
### FileUploader.hs ### FileUploader.hs
``` haskell ``` haskell
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs --package optparse-applicative --package filepath -- stack --resolver lts-9.1 runghc --package minio-hs --package optparse-applicative --package filepath
{-# Language OverloadedStrings, ScopedTypeVariables #-} {-# Language OverloadedStrings, ScopedTypeVariables #-}
import Network.Minio import Network.Minio

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs -- stack --resolver lts-9.1 runghc --package minio-hs
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs -- stack --resolver lts-9.1 runghc --package minio-hs
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.
@ -17,11 +17,11 @@
-- limitations under the License. -- limitations under the License.
-- --
{-# Language OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
import Network.Minio import Network.Minio
import Control.Monad.Catch (catchIf) import Control.Monad.Catch (catchIf)
import qualified Data.Text as T import qualified Data.Text as T
import Prelude import Prelude
-- | The following example uses minio's play server at -- | The following example uses minio's play server at
@ -55,5 +55,5 @@ main = do
} }
case res1 of case res1 of
Left e -> putStrLn $ "copyObject failed." ++ (show e) Left e -> putStrLn $ "copyObject failed." ++ (show e)
Right () -> putStrLn "copyObject succeeded." Right () -> putStrLn "copyObject succeeded."

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs --package optparse-applicative --package filepath -- stack --resolver lts-9.1 runghc --package minio-hs --package optparse-applicative --package filepath
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.
@ -18,16 +18,17 @@
-- --
{-# Language OverloadedStrings, ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-}
import Network.Minio {-# LANGUAGE ScopedTypeVariables #-}
import Network.Minio
import Control.Monad.Catch (catchIf) import Control.Monad.Catch (catchIf)
import Control.Monad.IO.Class (liftIO) import Control.Monad.IO.Class (liftIO)
import Data.Monoid ((<>)) import Data.Monoid ((<>))
import Data.Text (pack) import Data.Text (pack)
import Options.Applicative import Options.Applicative
import Prelude import Prelude
import System.FilePath.Posix import System.FilePath.Posix
-- | The following example uses minio's play server at -- | The following example uses minio's play server at
-- https://play.minio.io:9000. The endpoint and associated -- https://play.minio.io:9000. The endpoint and associated
@ -69,5 +70,5 @@ main = do
fPutObject bucket object filepath fPutObject bucket object filepath
case res of case res of
Left e -> putStrLn $ "file upload failed due to " ++ (show e) Left e -> putStrLn $ "file upload failed due to " ++ (show e)
Right () -> putStrLn "file upload succeeded." Right () -> putStrLn "file upload succeeded."

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs -- stack --resolver lts-9.1 runghc --package minio-hs
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.
@ -17,12 +17,12 @@
-- limitations under the License. -- limitations under the License.
-- --
{-# Language OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
import Network.Minio import Network.Minio
import Data.Conduit (($$+-)) import Data.Conduit (($$+-))
import Data.Conduit.Binary (sinkLbs) import Data.Conduit.Binary (sinkLbs)
import Prelude import Prelude
-- | The following example uses minio's play server at -- | The following example uses minio's play server at
-- https://play.minio.io:9000. The endpoint and associated -- https://play.minio.io:9000. The endpoint and associated
@ -41,5 +41,5 @@ main = do
(src $$+- sinkLbs) (src $$+- sinkLbs)
case res of case res of
Left e -> putStrLn $ "getObject failed." ++ (show e) Left e -> putStrLn $ "getObject failed." ++ (show e)
Right _ -> putStrLn "getObject succeeded." Right _ -> putStrLn "getObject succeeded."

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs -- stack --resolver lts-9.1 runghc --package minio-hs
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.
@ -17,11 +17,11 @@
-- limitations under the License. -- limitations under the License.
-- --
{-# Language OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
import Network.Minio.S3API import Network.Minio
import Network.Minio import Network.Minio.S3API
import Prelude import Prelude
-- | The following example uses minio's play server at -- | The following example uses minio's play server at
-- https://play.minio.io:9000. The endpoint and associated -- https://play.minio.io:9000. The endpoint and associated
@ -39,5 +39,5 @@ main = do
headObject bucket object headObject bucket object
case res of case res of
Left e -> putStrLn $ "headObject failed." ++ show e Left e -> putStrLn $ "headObject failed." ++ show e
Right objInfo -> putStrLn $ "headObject succeeded." ++ show objInfo Right objInfo -> putStrLn $ "headObject succeeded." ++ show objInfo

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs -- stack --resolver lts-9.1 runghc --package minio-hs
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.
@ -17,11 +17,11 @@
-- limitations under the License. -- limitations under the License.
-- --
{-# Language OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
import Network.Minio import Network.Minio
import Control.Monad.IO.Class (liftIO) import Control.Monad.IO.Class (liftIO)
import Prelude import Prelude
-- | The following example uses minio's play server at -- | The following example uses minio's play server at
-- https://play.minio.io:9000. The endpoint and associated -- https://play.minio.io:9000. The endpoint and associated

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs -- stack --resolver lts-9.1 runghc --package minio-hs
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.
@ -17,12 +17,12 @@
-- limitations under the License. -- limitations under the License.
-- --
{-# Language OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
import Network.Minio import Network.Minio
import Data.Conduit (($$)) import Data.Conduit (($$))
import Data.Conduit.Combinators (sinkList) import Data.Conduit.Combinators (sinkList)
import Prelude import Prelude
-- | The following example uses minio's play server at -- | The following example uses minio's play server at
-- https://play.minio.io:9000. The endpoint and associated -- https://play.minio.io:9000. The endpoint and associated

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs -- stack --resolver lts-9.1 runghc --package minio-hs
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.
@ -17,10 +17,10 @@
-- limitations under the License. -- limitations under the License.
-- --
{-# Language OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
import Network.Minio import Network.Minio
import qualified Data.Conduit as C import qualified Data.Conduit as C
import qualified Data.Conduit.Combinators as CC import qualified Data.Conduit.Combinators as CC
import Prelude import Prelude

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs -- stack --resolver lts-9.1 runghc --package minio-hs
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.
@ -18,7 +18,7 @@
-- --
{-# Language OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
import Network.Minio import Network.Minio
import Prelude import Prelude

View File

@ -40,7 +40,7 @@ main = do
res <- runMinio minioPlayCI $ do res <- runMinio minioPlayCI $ do
-- generate a URL with 7 days expiry time -- generate a URL with 7 days expiry time
presignedPutObjectURL "my-bucket" "my-object" (7*24*3600) headers presignedPutObjectUrl "my-bucket" "my-object" (7*24*3600) headers
case res of case res of
Left e -> putStrLn $ "presignedPutObject URL failed." ++ show e Left e -> putStrLn $ "presignedPutObject URL failed." ++ show e
@ -54,6 +54,6 @@ main = do
["curl "] ++ map hdrOpt headers ++ ["curl "] ++ map hdrOpt headers ++
["-T /tmp/myfile", B.concat ["'", url, "'"]] ["-T /tmp/myfile", B.concat ["'", url, "'"]]
B.putStrLn $ "The following curl command would use the presigned " ++ putStrLn $ "The following curl command would use the presigned " ++
"URL to upload the file at \"/tmp/myfile\":" "URL to upload the file at \"/tmp/myfile\":"
B.putStrLn curlCmd B.putStrLn curlCmd

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs -- stack --resolver lts-9.1 runghc --package minio-hs
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs -- stack --resolver lts-9.1 runghc --package minio-hs
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.
@ -17,10 +17,10 @@
-- limitations under the License. -- limitations under the License.
-- --
{-# Language OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
import Network.Minio import Network.Minio
import Prelude import Prelude
-- | The following example uses minio's play server at -- | The following example uses minio's play server at
-- https://play.minio.io:9000. The endpoint and associated -- https://play.minio.io:9000. The endpoint and associated

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs -- stack --resolver lts-9.1 runghc --package minio-hs
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.
@ -17,10 +17,10 @@
-- limitations under the License. -- limitations under the License.
-- --
{-# Language OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
import Network.Minio import Network.Minio
import Prelude import Prelude
main :: IO () main :: IO ()
main = do main = do

View File

@ -1,5 +1,5 @@
#!/usr/bin/env stack #!/usr/bin/env stack
-- stack --resolver lts-8.5 runghc --package minio-hs -- stack --resolver lts-9.1 runghc --package minio-hs
-- --
-- Minio Haskell SDK, (C) 2017 Minio, Inc. -- Minio Haskell SDK, (C) 2017 Minio, Inc.
@ -18,7 +18,7 @@
-- --
{-# Language OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
import Network.Minio import Network.Minio
import Prelude import Prelude