ganeti

Safe HaskellNone

Ganeti.THH.RPC

Description

Implements Template Haskell generation of RPC server components from Haskell functions.

Synopsis

Documentation

type RpcServer m = Handler Request m JSValue Source #

data Request Source #

A RPC request consiting of a method and its argument(s).

Constructors

Request 

Fields

Instances
Eq Request # 
Instance details

Defined in Ganeti.THH.RPC

Methods

(==) :: Request -> Request -> Bool

(/=) :: Request -> Request -> Bool

Ord Request # 
Instance details

Defined in Ganeti.THH.RPC

Methods

compare :: Request -> Request -> Ordering

(<) :: Request -> Request -> Bool

(<=) :: Request -> Request -> Bool

(>) :: Request -> Request -> Bool

(>=) :: Request -> Request -> Bool

max :: Request -> Request -> Request

min :: Request -> Request -> Request

Show Request # 
Instance details

Defined in Ganeti.THH.RPC

Methods

showsPrec :: Int -> Request -> ShowS

show :: Request -> String

showList :: [Request] -> ShowS

dispatch :: Monad m => Map String (RpcFn (ResultT GanetiException m)) -> RpcServer m Source #

mkRpcM Source #

Arguments

:: [Name]

the names of functions to include

-> Q Exp 

Takes a list of function names and creates a RPC handler that delegates calls to them.

The functions must conform to (J.JSON i, J.JSON o) => i -> ResultT GanetiException m o. The m monads types of all the functions must unify.

The result expression is of type RpcServer m.