lackey: Generate Ruby clients from Servant APIs.

[ library, mit, web ] [ Propose Tags ]

Lackey generates Ruby clients from Servant APIs.


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0, 0.1.1, 0.1.2, 0.2.0, 0.3.0, 0.3.1, 0.3.2, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.5, 0.4.6, 0.4.7, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9, 1.0.10, 1.0.11, 1.0.12, 1.0.13, 1.0.14, 1.0.15, 1.0.16, 2.0.0.0, 2.0.0.1, 2.0.0.2, 2.0.0.3, 2.0.0.4, 2.0.0.5, 2.0.0.6, 2.0.0.7
Change log CHANGELOG.md
Dependencies base (>=4.8 && <4.11), servant (>=0.8 && <0.13), servant-foreign (>=0.8 && <0.11), text (>=1.2 && <1.3) [details]
License MIT
Author
Maintainer Taylor Fausak
Category Web
Home page https://github.com/tfausak/lackey#readme
Bug tracker https://github.com/tfausak/lackey/issues
Source repo head: git clone https://github.com/tfausak/lackey
Uploaded by fozworth at 2018-01-26T16:34:59Z
Distributions LTSHaskell:2.0.0.7, NixOS:2.0.0.7, Stackage:2.0.0.7
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 16728 total (66 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-01-26 [all 1 reports]

Readme for lackey-1.0.0

[back to package description]

Lackey

Version badge Build badge

Lackey is a Haskell library for generating Ruby consumers of Servant APIs.

Use Lackey.rubyForAPI to generate a string of Ruby source code for consuming a Servant API. For example:

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}

import qualified Data.Proxy as Proxy
import qualified Data.Text as Text
import qualified Data.Text.IO as Text
import qualified Lackey
import Servant.API

type API = "words" :> Get '[JSON] [String]

api :: Proxy.Proxy API
api = Proxy.Proxy

ruby :: Text.Text
ruby = Lackey.rubyForAPI api

main :: IO ()
main = Text.putStrLn ruby
-- def get_words(excon)excon.request(:method=>:get,:path=>"/words",:headers=>{},:body=>nil)end

The generated functions require Excon.