servant-jsonrpc-server-1.0.0: JSON-RPC servant servers

Safe HaskellNone
LanguageHaskell2010

Servant.Server.JsonRpc

Contents

Description

This module provides support for writing handlers for JSON-RPC endpoints

type Mul = JsonRpcEndpoint "mul" (Int, Int) String Int
mulHandler :: (Int, Int) -> Handler (Either (JsonRpcErr String) Int)
mulHandler = _

server :: Application
server = serve (Proxy @Mul) mulHandler

Documentation

Orphan instances

(KnownSymbol method, FromJSON p) => HasServer (JsonRpcNotification method p :: Type) context Source # 
Instance details

Associated Types

type ServerT (JsonRpcNotification method p) m :: Type #

Methods

route :: Proxy (JsonRpcNotification method p) -> Context context -> Delayed env (Server (JsonRpcNotification method p)) -> Router env #

hoistServerWithContext :: Proxy (JsonRpcNotification method p) -> Proxy context -> (forall x. m x -> n x) -> ServerT (JsonRpcNotification method p) m -> ServerT (JsonRpcNotification method p) n #

(KnownSymbol method, FromJSON p, ToJSON e, ToJSON r) => HasServer (JsonRpc method p e r :: Type) context Source # 
Instance details

Associated Types

type ServerT (JsonRpc method p e r) m :: Type #

Methods

route :: Proxy (JsonRpc method p e r) -> Context context -> Delayed env (Server (JsonRpc method p e r)) -> Router env #

hoistServerWithContext :: Proxy (JsonRpc method p e r) -> Proxy context -> (forall x. m x -> n x) -> ServerT (JsonRpc method p e r) m -> ServerT (JsonRpc method p e r) n #