Revision 95d0d502
b/htools/Ganeti/Luxi.hs | ||
---|---|---|
29 | 29 |
( LuxiOp(..) |
30 | 30 |
, QrViaLuxi(..) |
31 | 31 |
, ResultStatus(..) |
32 |
, LuxiReq(..) |
|
32 | 33 |
, Client |
33 | 34 |
, checkRS |
34 | 35 |
, getClient |
... | ... | |
144 | 145 |
) |
145 | 146 |
]) |
146 | 147 |
|
148 |
$(makeJSONInstance ''LuxiReq) |
|
149 |
|
|
147 | 150 |
-- | The serialisation of LuxiOps into strings in messages. |
148 | 151 |
$(genStrOfOp ''LuxiOp "strOfOp") |
149 | 152 |
|
b/htools/Ganeti/THH.hs | ||
---|---|---|
543 | 543 |
cons |
544 | 544 |
let declD = DataD [] (mkName name) [] decl_d [''Show, ''Read] |
545 | 545 |
(savesig, savefn) <- genSaveLuxiOp cons |
546 |
return [declD, savesig, savefn] |
|
546 |
req_defs <- declareSADT "LuxiReq" . |
|
547 |
map (\(str, _) -> ("Req" ++ str, mkName ("luxiReq" ++ str))) $ |
|
548 |
cons |
|
549 |
return $ [declD, savesig, savefn] ++ req_defs |
|
547 | 550 |
|
548 | 551 |
-- | Generates the \"save\" expression for a single luxi parameter. |
549 | 552 |
saveLuxiField :: Name -> LuxiParam -> Q Exp |
Also available in: Unified diff