From b0dbc83dd5d1c542cffd240dc9343e841992c3fe Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Wed, 26 Sep 2018 22:31:59 +0300 Subject: improved debug handlers --- cmd/util/client.go | 18 ------------------ cmd/util/rpc.go | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 cmd/util/client.go create mode 100644 cmd/util/rpc.go diff --git a/cmd/util/client.go b/cmd/util/client.go deleted file mode 100644 index ee3414a6..00000000 --- a/cmd/util/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package util - -import ( - "errors" - "github.com/spiral/roadrunner/service" - rrpc "github.com/spiral/roadrunner/service/rpc" - "net/rpc" -) - -// RPCClient returns RPC client associated with given roadrunner service container. -func RPCClient(container service.Container) (*rpc.Client, error) { - svc, st := container.Get(rrpc.ID) - if st < service.StatusOK { - return nil, errors.New("RPC service is not configured") - } - - return svc.(*rrpc.Service).Client() -} diff --git a/cmd/util/rpc.go b/cmd/util/rpc.go new file mode 100644 index 00000000..ee3414a6 --- /dev/null +++ b/cmd/util/rpc.go @@ -0,0 +1,18 @@ +package util + +import ( + "errors" + "github.com/spiral/roadrunner/service" + rrpc "github.com/spiral/roadrunner/service/rpc" + "net/rpc" +) + +// RPCClient returns RPC client associated with given roadrunner service container. +func RPCClient(container service.Container) (*rpc.Client, error) { + svc, st := container.Get(rrpc.ID) + if st < service.StatusOK { + return nil, errors.New("RPC service is not configured") + } + + return svc.(*rrpc.Service).Client() +} -- cgit v1.2.3