yaml-rpc 1.0 → 1.0.1
raw patch · 3 files changed
+10/−18 lines, 3 files
Files
- Network/YAML/TH/Dispatcher.hs +0/−2
- README.md +6/−7
- yaml-rpc.cabal +4/−9
Network/YAML/TH/Dispatcher.hs view
@@ -61,8 +61,6 @@ let nameStr = T.unpack methodName let name = mkName nameStr let other = go method ms- argNames <- forM (zip [0..] $ methodArgs m) $ \(i, _) ->- newName $ "arg" ++ show i [| if $(varE method) == $(return $ LitE $ StringL nameStr) then Just $ toValueFn $(varE name) else $(other) |]
README.md view
@@ -4,7 +4,7 @@ Ilya V. Portnov <portnov84@rambler.ru> The yaml-rpc package contains a small library to organize remote procedure call-(RPC) over TCP/IP network, using YAML as data serialization format.+(RPC) over TCP/IP network, using JSON as data serialization format. RPC server should supply a set of "RPC methods", which are simply functions :: a -> b -> ... -> IO c. Arguments must be of class ToJSON (defined in aeson package);@@ -14,17 +14,16 @@ generate API description for server. Such API can be automatically written to file in simple YAML format by using function Network.YAML.TH.Server.writeAPI. It is possible to write different servers, which will use generated API-description and provide HTTP REST YAML services with that API. Currently there+description and provide HTTP REST JSON services with that API. Currently there is only one implementation using scotty package; it is provided by yaml-rpc-scotty package. Please see yaml-rpc-scotty/Test/{Server.hs, TestAPIImpl.hs} files for example usage. -RPC client calls that functions via HTTP REST YAML interface. So, it can be-used either from Haskell or from any other environment. For example, though-HTTP REST YAML is nearly a superset of HTTP REST JSON, it can be easily used-from JavaScript with JQuery or another framework.+RPC client calls that functions via HTTP REST JSON interface. So, it can be+used either from Haskell or from any other environment. For example, it can be+easily used from JavaScript with JQuery or another framework. For Haskell, yaml-rpc package provides a function Network.YAML.Caller.call to-call any method via HTTP REST YAML interface. Moreover, a (TemplateHaskell)+call any method via HTTP REST JSON interface. Moreover, a (TemplateHaskell) function Network.YAML.TH.Client.useAPI function will read API description from file (in YAML format) and generate wrapper methods for calling respective remote methods. Please see Test/Client.hs for example usage.
yaml-rpc.cabal view
@@ -1,6 +1,6 @@ Name: yaml-rpc -Version: 1.0+Version: 1.0.1 -- A short (one-line) description of the package. Synopsis: Simple library for network (HTTP REST-like) YAML RPC@@ -34,7 +34,9 @@ -- Extra files to be distributed with the package, such as examples or -- a README.-Extra-source-files: README.md+Extra-source-files: README.md,+ Test/Client.hs,+ Test/TestAPI.hs -- Constraint on the version of Cabal needed to build this package. Cabal-version: >= 1.8@@ -65,13 +67,6 @@ http-types >= 0.8.5, http-client >= 0.3.3.1, lens >= 4.2- - -- Modules not exported by this package.- Other-modules: Test.Client,- Test.TestAPI- - -- Extra tools (e.g. alex, hsc2hs, ...) needed to build the source.- -- Build-tools: Source-repository head type: git