summaryrefslogtreecommitdiff
path: root/cmd/rr/http
diff options
context:
space:
mode:
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 {