forked from haskell-servant/servant
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request haskell-servant#31 from haskell-servant/merge
Merge all repos
- Loading branch information
Showing
96 changed files
with
6,024 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
dist | ||
bin | ||
lib | ||
share | ||
packages | ||
*-packages.conf.d | ||
cabal-dev | ||
add-source-timestamps | ||
*.o | ||
*.hi | ||
*.chi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash - | ||
#=============================================================================== | ||
# | ||
# FILE: test-all.sh | ||
# | ||
# USAGE: ./test-all.sh | ||
# | ||
# DESCRIPTION: Run tests for all source directories listed in $SOURCES. | ||
# Uses local versions of those sources. | ||
# | ||
#=============================================================================== | ||
|
||
set -o nounset | ||
set -o errexit | ||
|
||
SOURCES=( servant servant-server servant-client servant-jquery servant-docs ) | ||
GHC_FLAGS="-Werror" | ||
|
||
prepare_sandbox () { | ||
cabal sandbox init | ||
for s in ${SOURCES[@]} ; do | ||
cd "$s" | ||
cabal sandbox init --sandbox=../ | ||
cabal sandbox add-source . | ||
cd .. | ||
done | ||
} | ||
|
||
test_each () { | ||
for s in ${SOURCES[@]} ; do | ||
echo "Testing $s..." | ||
cd "$s" | ||
cabal install --only-dependencies --enable-tests | ||
cabal configure --enable-tests --ghc-options="$GHC_FLAGS" | ||
cabal build | ||
cabal test | ||
cd .. | ||
done | ||
} | ||
|
||
prepare_sandbox | ||
test_each |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
0.3 | ||
--- | ||
* Support content-type aware combinators and `Accept`/`Content-type` headers | ||
* Added a lot of tests | ||
* Support multiple concurrent threads | ||
* Use `ServantError` to report Errors instead of `String` | ||
* Make the clients for `Raw` endpoints return the whole `Response` value (to be able to access response headers for example) | ||
* Support for PATCH | ||
* Make () instances expect No Content status code, and not try to decode body. | ||
* `Canonicalize` API types before generating client functions for them | ||
|
||
0.2.2 | ||
----- | ||
* Add TLS support | ||
* Add matrix parameter support |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# servant-client | ||
|
||
[](http://travis-ci.org/haskell-servant/servant-client) | ||
[](https://coveralls.io/r/haskell-servant/servant-client) | ||
|
||
 | ||
|
||
This library lets you automatically derive Haskell functions that let you query each endpoint of a *servant* webservice. | ||
|
||
## Example | ||
|
||
``` haskell | ||
type MyApi = "books" :> Get [Book] -- GET /books | ||
:<|> "books" :> ReqBody Book :> Post Book -- POST /books | ||
|
||
myApi :: Proxy MyApi | ||
myApi = Proxy | ||
|
||
getAllBooks :: BaseUrl -> EitherT String IO [Book] | ||
postNewBook :: Book -> BaseUrl -> EitherT String IO Book | ||
-- 'client' allows you to produce operations to query an API from a client. | ||
(getAllBooks :<|> postNewBook) = client myApi | ||
``` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
SERVANT_DIR=/tmp/servant-client-gh-pages | ||
|
||
# Make a temporary clone | ||
|
||
rm -rf $SERVANT_DIR | ||
|
||
git clone . $SERVANT_DIR | ||
|
||
cd $SERVANT_DIR | ||
|
||
# Make sure to pull the latest | ||
|
||
git remote add haskell-servant [email protected]:haskell-servant/servant-client.git | ||
|
||
git fetch haskell-servant | ||
|
||
git reset --hard haskell-servant/gh-pages | ||
|
||
# Clear everything away | ||
|
||
git rm -rf $SERVANT_DIR/* | ||
|
||
# Switch back and build the haddocks | ||
|
||
cd - | ||
|
||
cabal configure --builddir=$SERVANT_DIR | ||
|
||
cabal haddock --hoogle --hyperlink-source --html-location='https://hackage.haskell.org/package/$pkg-$version/docs' --builddir=$SERVANT_DIR | ||
|
||
commit_hash=$(git rev-parse HEAD) | ||
|
||
# Move the HTML docs to the root | ||
|
||
cd $SERVANT_DIR | ||
|
||
rm * | ||
rm -rf build | ||
mv doc/html/servant-client/* . | ||
rm -r doc/ | ||
|
||
# Add everything | ||
|
||
git add . | ||
|
||
git commit -m "Built from $commit_hash" | ||
|
||
# Push to update the pages | ||
|
||
git push haskell-servant HEAD:gh-pages | ||
|
||
rm -rf $SERVANT_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: servant-client | ||
version: 0.2.2 | ||
synopsis: automatical derivation of querying functions for servant webservices | ||
description: | ||
This library lets you derive automatically Haskell functions that | ||
let you query each endpoint of a <http://hackage.haskell.org/package/servant servant> webservice. | ||
. | ||
Example below. | ||
. | ||
> type MyApi = "books" :> Get [Book] -- GET /books | ||
> :<|> "books" :> ReqBody Book :> Post Book -- POST /books | ||
> | ||
> myApi :: Proxy MyApi | ||
> myApi = Proxy | ||
> | ||
> getAllBooks :: BaseUrl -> EitherT String IO [Book] | ||
> postNewBook :: Book -> BaseUrl -> EitherT String IO Book | ||
> (getAllBooks :<|> postNewBook) = client myApi | ||
license: BSD3 | ||
license-file: LICENSE | ||
author: Alp Mestanogullari, Sönke Hahn, Julian K. Arni | ||
maintainer: [email protected] | ||
copyright: 2014 Zalora South East Asia Pte Ltd | ||
category: Web | ||
build-type: Simple | ||
cabal-version: >=1.10 | ||
tested-with: GHC >= 7.8 | ||
homepage: http://haskell-servant.github.io/ | ||
Bug-reports: http://github.com/haskell-servant/servant-client/issues | ||
source-repository head | ||
type: git | ||
location: http://github.com/haskell-servant/servant-client.git | ||
|
||
library | ||
exposed-modules: | ||
Servant.Client | ||
Servant.Common.BaseUrl | ||
Servant.Common.Req | ||
build-depends: | ||
base >=4.7 && <5 | ||
, aeson | ||
, attoparsec | ||
, bytestring | ||
, either | ||
, exceptions | ||
, http-client | ||
, http-client-tls | ||
, http-media | ||
, http-types | ||
, network-uri >= 2.6 | ||
, safe | ||
, servant >= 0.2.2 | ||
, string-conversions | ||
, text | ||
, transformers | ||
hs-source-dirs: src | ||
default-language: Haskell2010 | ||
ghc-options: -Wall | ||
|
||
test-suite spec | ||
type: exitcode-stdio-1.0 | ||
ghc-options: | ||
-Wall -fno-warn-name-shadowing -fno-warn-missing-signatures | ||
default-language: Haskell2010 | ||
hs-source-dirs: test | ||
main-is: Spec.hs | ||
build-depends: | ||
base == 4.* | ||
, aeson | ||
, bytestring | ||
, deepseq | ||
, either | ||
, hspec == 2.* | ||
, http-client | ||
, http-media | ||
, http-types | ||
, HUnit | ||
, network >= 2.6 | ||
, QuickCheck >= 2.7 | ||
, servant >= 0.2.1 | ||
, servant-client | ||
, servant-server >= 0.2.1 | ||
, text | ||
, wai | ||
, warp |
Oops, something went wrong.