summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2020-10-25 18:29:20 +0300
committerWolfy-J <[email protected]>2020-10-25 18:29:20 +0300
commitbf6622d8537773b840ca3610b3ed05d492da1017 (patch)
treeedf83ffa7912a9eb3752c222ba81369f3dc1e684 /plugins
parenta7784cd8d54ab16244e7f2f9c2a2361095b3c910 (diff)
- added service names
Diffstat (limited to 'plugins')
-rw-r--r--plugins/rpc/rpc.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/rpc/rpc.go b/plugins/rpc/rpc.go
index 8ffe62e0..a17b569f 100644
--- a/plugins/rpc/rpc.go
+++ b/plugins/rpc/rpc.go
@@ -1,14 +1,18 @@
package rpc
import (
+ "github.com/spiral/endure"
"github.com/spiral/endure/errors"
"github.com/spiral/goridge/v2"
"github.com/spiral/roadrunner/v2/plugins/config"
"net/rpc"
)
-type RPCService interface {
- Name() string
+// RPCPluggable declares the ability to create set of public RPC methods.
+type RPCPluggable interface {
+ endure.Named
+
+ // Provides RPC methods for the given service.
RPCService() (interface{}, error)
}
@@ -110,7 +114,7 @@ func (s *Service) Depends() []interface{} {
}
}
-func (s *Service) RegisterService(p RPCService) error {
+func (s *Service) RegisterService(p RPCPluggable) error {
service, err := p.RPCService()
if err != nil {
return err