summaryrefslogtreecommitdiff
path: root/cmd/rr/http
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-03 13:08:48 +0300
committerWolfy-J <[email protected]>2018-06-03 13:08:48 +0300
commitf363040a9a72d53b4d5f0ffbf40773a27e9bd98f (patch)
tree89fcde37773d2a5fd394c1149b308a0096ed2820 /cmd/rr/http
parent00eaa539e333184bdfb73fe3347bc5358de8a551 (diff)
CS
Diffstat (limited to 'cmd/rr/http')
-rw-r--r--cmd/rr/http/register.go13
-rw-r--r--cmd/rr/http/reload.go8
-rw-r--r--cmd/rr/http/workers.go8
3 files changed, 13 insertions, 16 deletions
diff --git a/cmd/rr/http/register.go b/cmd/rr/http/register.go
index b8447ed4..a725f5f2 100644
--- a/cmd/rr/http/register.go
+++ b/cmd/rr/http/register.go
@@ -3,8 +3,21 @@ package http
import (
rr "github.com/spiral/roadrunner/cmd/rr/cmd"
"github.com/spiral/roadrunner/http"
+ "github.com/spf13/cobra"
)
func init() {
rr.Services.Register(&http.Service{})
+
+ rr.CLI.AddCommand(&cobra.Command{
+ Use: "http:reload",
+ Short: "Reload RoadRunner worker pools for the HTTP service",
+ Run: reloadHandler,
+ })
+
+ rr.CLI.AddCommand(&cobra.Command{
+ Use: "http:workers",
+ Short: "List workers associated with RoadRunner HTTP service",
+ Run: workersHandler,
+ })
}
diff --git a/cmd/rr/http/reload.go b/cmd/rr/http/reload.go
index 4bd847c3..89c0b74b 100644
--- a/cmd/rr/http/reload.go
+++ b/cmd/rr/http/reload.go
@@ -26,14 +26,6 @@ import (
rr "github.com/spiral/roadrunner/cmd/rr/cmd"
)
-func init() {
- rr.Root.AddCommand(&cobra.Command{
- Use: "http:reload",
- Short: "Reload RoadRunner worker pools for the HTTP service",
- Run: reloadHandler,
- })
-}
-
func reloadHandler(cmd *cobra.Command, args []string) {
client, err := rr.Services.RCPClient()
if err != nil {
diff --git a/cmd/rr/http/workers.go b/cmd/rr/http/workers.go
index fb34d0b5..19fc6df8 100644
--- a/cmd/rr/http/workers.go
+++ b/cmd/rr/http/workers.go
@@ -29,14 +29,6 @@ import (
"strconv"
)
-func init() {
- rr.Root.AddCommand(&cobra.Command{
- Use: "http:workers",
- Short: "List workers associated with RoadRunner HTTP service",
- Run: workersHandler,
- })
-}
-
func workersHandler(cmd *cobra.Command, args []string) {
client, err := rr.Services.RCPClient()
if err != nil {