aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/comms/inproc.go
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/comms/inproc.go')
-rw-r--r--rpc/comms/inproc.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/rpc/comms/inproc.go b/rpc/comms/inproc.go
index 1fdbf8ace..b9c4e93d9 100644
--- a/rpc/comms/inproc.go
+++ b/rpc/comms/inproc.go
@@ -51,3 +51,21 @@ func (self *InProcClient) Send(req interface{}) error {
func (self *InProcClient) Recv() (interface{}, error) {
return self.lastRes, self.lastErr
}
+
+func (self *InProcClient) SupportedModules() (map[string]string, error) {
+ req := shared.Request{
+ Id: 1,
+ Jsonrpc: "2.0",
+ Method: "modules",
+ }
+
+ if res, err := self.api.Execute(&req); err == nil {
+ if result, ok := res.(map[string]string); ok {
+ return result, nil
+ }
+ } else {
+ return nil, err
+ }
+
+ return nil, fmt.Errorf("Invalid response")
+}