From bf6622d8537773b840ca3610b3ed05d492da1017 Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Sun, 25 Oct 2020 18:29:20 +0300 Subject: - added service names --- plugins/rpc/rpc.go | 10 +++++++--- 1 file 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 -- cgit v1.2.3