diff options
author | Wolfy-J <[email protected]> | 2020-10-25 18:29:20 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2020-10-25 18:29:20 +0300 |
commit | bf6622d8537773b840ca3610b3ed05d492da1017 (patch) | |
tree | edf83ffa7912a9eb3752c222ba81369f3dc1e684 /plugins/rpc | |
parent | a7784cd8d54ab16244e7f2f9c2a2361095b3c910 (diff) |
- added service names
Diffstat (limited to 'plugins/rpc')
-rw-r--r-- | plugins/rpc/rpc.go | 10 |
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 |