diff options
author | Valery Piashchynski <[email protected]> | 2022-01-15 15:52:23 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2022-01-15 15:52:23 +0300 |
commit | 65541b95a6ebc72aef818f1d2e4b0dc721f59e22 (patch) | |
tree | d9dbe5577c72810fadf1f2bc1e5fcee889fda983 /internal | |
parent | 5254c8eb27311e2a8a53a4c90c3829cf1238c563 (diff) |
initial commit
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'internal')
-rw-r--r-- | internal/cli/reset/command.go | 6 | ||||
-rw-r--r-- | internal/cli/reset/command_test.go | 4 | ||||
-rw-r--r-- | internal/cli/root.go | 12 | ||||
-rw-r--r-- | internal/cli/root_test.go | 2 | ||||
-rw-r--r-- | internal/cli/serve/command.go | 8 | ||||
-rw-r--r-- | internal/cli/serve/command_test.go | 4 | ||||
-rw-r--r-- | internal/cli/workers/command.go | 8 | ||||
-rw-r--r-- | internal/cli/workers/command_test.go | 4 | ||||
-rw-r--r-- | internal/cli/workers/render.go | 2 | ||||
-rw-r--r-- | internal/container/config.go | 4 | ||||
-rw-r--r-- | internal/container/config_test.go | 6 | ||||
-rw-r--r-- | internal/container/container.go | 2 | ||||
-rw-r--r-- | internal/container/container_test.go | 4 | ||||
-rw-r--r-- | internal/container/plugins.go | 102 | ||||
-rw-r--r-- | internal/container/plugins_test.go | 20 | ||||
-rw-r--r-- | internal/debug/server_test.go | 2 | ||||
-rw-r--r-- | internal/rpc/client.go | 8 | ||||
-rw-r--r-- | internal/rpc/client_test.go | 4 |
18 files changed, 42 insertions, 160 deletions
diff --git a/internal/cli/reset/command.go b/internal/cli/reset/command.go index d6cf7087..1d7dd78c 100644 --- a/internal/cli/reset/command.go +++ b/internal/cli/reset/command.go @@ -4,13 +4,13 @@ import ( "fmt" "sync" - internalRpc "github.com/spiral/roadrunner-binary/v2/internal/rpc" + internalRpc "github.com/roadrunner-server/roadrunner/v2/internal/rpc" "github.com/fatih/color" "github.com/mattn/go-runewidth" + "github.com/roadrunner-server/config/v2" + "github.com/roadrunner-server/errors" "github.com/spf13/cobra" - "github.com/spiral/errors" - "github.com/spiral/roadrunner-plugins/v2/config" "github.com/vbauerster/mpb/v5" "github.com/vbauerster/mpb/v5/decor" ) diff --git a/internal/cli/reset/command_test.go b/internal/cli/reset/command_test.go index 00cd046e..1983cc5c 100644 --- a/internal/cli/reset/command_test.go +++ b/internal/cli/reset/command_test.go @@ -3,9 +3,9 @@ package reset_test import ( "testing" - "github.com/spiral/roadrunner-binary/v2/internal/cli/reset" + "github.com/roadrunner-server/roadrunner/v2/internal/cli/reset" - "github.com/spiral/roadrunner-plugins/v2/config" + "github.com/roadrunner-server/config/v2" "github.com/stretchr/testify/assert" ) diff --git a/internal/cli/root.go b/internal/cli/root.go index 8572bdc6..29fd14b8 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -6,15 +6,15 @@ import ( "path/filepath" "runtime" - "github.com/spiral/roadrunner-binary/v2/internal/cli/reset" - "github.com/spiral/roadrunner-binary/v2/internal/cli/serve" - "github.com/spiral/roadrunner-binary/v2/internal/cli/workers" - dbg "github.com/spiral/roadrunner-binary/v2/internal/debug" - "github.com/spiral/roadrunner-binary/v2/internal/meta" + "github.com/roadrunner-server/roadrunner/v2/internal/cli/reset" + "github.com/roadrunner-server/roadrunner/v2/internal/cli/serve" + "github.com/roadrunner-server/roadrunner/v2/internal/cli/workers" + dbg "github.com/roadrunner-server/roadrunner/v2/internal/debug" + "github.com/roadrunner-server/roadrunner/v2/internal/meta" "github.com/joho/godotenv" + "github.com/roadrunner-server/config/v2" "github.com/spf13/cobra" - "github.com/spiral/roadrunner-plugins/v2/config" ) // NewCommand creates root command. diff --git a/internal/cli/root_test.go b/internal/cli/root_test.go index 59af9294..28e7d237 100644 --- a/internal/cli/root_test.go +++ b/internal/cli/root_test.go @@ -3,7 +3,7 @@ package cli_test import ( "testing" - "github.com/spiral/roadrunner-binary/v2/internal/cli" + "github.com/roadrunner-server/roadrunner/v2/internal/cli" "github.com/spf13/cobra" "github.com/stretchr/testify/assert" diff --git a/internal/cli/serve/command.go b/internal/cli/serve/command.go index 6679d795..a0ce36db 100644 --- a/internal/cli/serve/command.go +++ b/internal/cli/serve/command.go @@ -6,12 +6,12 @@ import ( "os/signal" "syscall" - "github.com/spiral/roadrunner-binary/v2/internal/container" - "github.com/spiral/roadrunner-binary/v2/internal/meta" + "github.com/roadrunner-server/roadrunner/v2/internal/container" + "github.com/roadrunner-server/roadrunner/v2/internal/meta" + configImpl "github.com/roadrunner-server/config/v2" + "github.com/roadrunner-server/errors" "github.com/spf13/cobra" - "github.com/spiral/errors" - configImpl "github.com/spiral/roadrunner-plugins/v2/config" ) // NewCommand creates `serve` command. diff --git a/internal/cli/serve/command_test.go b/internal/cli/serve/command_test.go index 0e61ce83..8aef0ff7 100644 --- a/internal/cli/serve/command_test.go +++ b/internal/cli/serve/command_test.go @@ -3,9 +3,9 @@ package serve_test import ( "testing" - "github.com/spiral/roadrunner-binary/v2/internal/cli/serve" + "github.com/roadrunner-server/roadrunner/v2/internal/cli/serve" - "github.com/spiral/roadrunner-plugins/v2/config" + "github.com/roadrunner-server/config/v2" "github.com/stretchr/testify/assert" ) diff --git a/internal/cli/workers/command.go b/internal/cli/workers/command.go index 283887e4..e3f8f7e3 100644 --- a/internal/cli/workers/command.go +++ b/internal/cli/workers/command.go @@ -9,14 +9,14 @@ import ( "time" "github.com/roadrunner-server/api/v2/plugins/jobs" - internalRpc "github.com/spiral/roadrunner-binary/v2/internal/rpc" + internalRpc "github.com/roadrunner-server/roadrunner/v2/internal/rpc" tm "github.com/buger/goterm" "github.com/fatih/color" + "github.com/roadrunner-server/config/v2" + "github.com/roadrunner-server/errors" + "github.com/roadrunner-server/informer/v2" "github.com/spf13/cobra" - "github.com/spiral/errors" - "github.com/spiral/roadrunner-plugins/v2/config" - "github.com/spiral/roadrunner-plugins/v2/informer" ) // NewCommand creates `workers` command. diff --git a/internal/cli/workers/command_test.go b/internal/cli/workers/command_test.go index e593686d..d0c92e63 100644 --- a/internal/cli/workers/command_test.go +++ b/internal/cli/workers/command_test.go @@ -3,9 +3,9 @@ package workers_test import ( "testing" - "github.com/spiral/roadrunner-binary/v2/internal/cli/workers" + "github.com/roadrunner-server/roadrunner/v2/internal/cli/workers" - "github.com/spiral/roadrunner-plugins/v2/config" + "github.com/roadrunner-server/config/v2" "github.com/stretchr/testify/assert" ) diff --git a/internal/cli/workers/render.go b/internal/cli/workers/render.go index 0bdf09b6..cf81a04e 100644 --- a/internal/cli/workers/render.go +++ b/internal/cli/workers/render.go @@ -9,7 +9,7 @@ import ( "github.com/fatih/color" "github.com/olekukonko/tablewriter" "github.com/roadrunner-server/api/v2/plugins/jobs" - "github.com/spiral/roadrunner/v2/state/process" + "github.com/roadrunner-server/sdk/v2/state/process" ) const ( diff --git a/internal/container/config.go b/internal/container/config.go index 54e2bb5b..149d6b9b 100644 --- a/internal/container/config.go +++ b/internal/container/config.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - endure "github.com/spiral/endure/pkg/container" - "github.com/spiral/roadrunner-plugins/v2/config" + "github.com/roadrunner-server/config/v2" + endure "github.com/roadrunner-server/endure/pkg/container" ) type Config struct { diff --git a/internal/container/config_test.go b/internal/container/config_test.go index 9919def4..e20b2d9e 100644 --- a/internal/container/config_test.go +++ b/internal/container/config_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - "github.com/spiral/roadrunner-binary/v2/internal/container" + "github.com/roadrunner-server/roadrunner/v2/internal/container" - endure "github.com/spiral/endure/pkg/container" - "github.com/spiral/roadrunner-plugins/v2/config" + "github.com/roadrunner-server/config/v2" + endure "github.com/roadrunner-server/endure/pkg/container" "github.com/stretchr/testify/assert" ) diff --git a/internal/container/container.go b/internal/container/container.go index aa767b2e..25ba6326 100644 --- a/internal/container/container.go +++ b/internal/container/container.go @@ -1,7 +1,7 @@ package container import ( - endure "github.com/spiral/endure/pkg/container" + endure "github.com/roadrunner-server/endure/pkg/container" ) // NewContainer creates endure container with all required options (based on container Config). Logger is nil by diff --git a/internal/container/container_test.go b/internal/container/container_test.go index c6d613a0..9be043e2 100644 --- a/internal/container/container_test.go +++ b/internal/container/container_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - "github.com/spiral/roadrunner-binary/v2/internal/container" + "github.com/roadrunner-server/roadrunner/v2/internal/container" - endure "github.com/spiral/endure/pkg/container" + endure "github.com/roadrunner-server/endure/pkg/container" "github.com/stretchr/testify/assert" ) diff --git a/internal/container/plugins.go b/internal/container/plugins.go index 6c962793..8a9fb253 100644 --- a/internal/container/plugins.go +++ b/internal/container/plugins.go @@ -1,104 +1,6 @@ package container -import ( - "github.com/spiral/roadrunner-plugins/v2/amqp" - "github.com/spiral/roadrunner-plugins/v2/beanstalk" - "github.com/spiral/roadrunner-plugins/v2/boltdb" - "github.com/spiral/roadrunner-plugins/v2/broadcast" - "github.com/spiral/roadrunner-plugins/v2/fileserver" - grpcPlugin "github.com/spiral/roadrunner-plugins/v2/grpc" - httpPlugin "github.com/spiral/roadrunner-plugins/v2/http" - "github.com/spiral/roadrunner-plugins/v2/http/middleware/gzip" - "github.com/spiral/roadrunner-plugins/v2/http/middleware/headers" - newrelic "github.com/spiral/roadrunner-plugins/v2/http/middleware/new_relic" - "github.com/spiral/roadrunner-plugins/v2/http/middleware/prometheus" - "github.com/spiral/roadrunner-plugins/v2/http/middleware/static" - "github.com/spiral/roadrunner-plugins/v2/http/middleware/websockets" - "github.com/spiral/roadrunner-plugins/v2/informer" - "github.com/spiral/roadrunner-plugins/v2/jobs" - "github.com/spiral/roadrunner-plugins/v2/kv" - "github.com/spiral/roadrunner-plugins/v2/logger" - "github.com/spiral/roadrunner-plugins/v2/memcached" - "github.com/spiral/roadrunner-plugins/v2/memory" - "github.com/spiral/roadrunner-plugins/v2/metrics" - "github.com/spiral/roadrunner-plugins/v2/nats" - "github.com/spiral/roadrunner-plugins/v2/redis" - "github.com/spiral/roadrunner-plugins/v2/reload" - "github.com/spiral/roadrunner-plugins/v2/resetter" - rpcPlugin "github.com/spiral/roadrunner-plugins/v2/rpc" - "github.com/spiral/roadrunner-plugins/v2/server" - "github.com/spiral/roadrunner-plugins/v2/service" - "github.com/spiral/roadrunner-plugins/v2/sqs" - "github.com/spiral/roadrunner-plugins/v2/status" - "github.com/spiral/roadrunner-plugins/v2/tcp" - roadrunner_temporal "github.com/temporalio/roadrunner-temporal" -) - // Plugins returns active plugins for the endure container. Feel free to add or remove any plugins. -func Plugins() []interface{} { //nolint:funlen - return []interface{}{ - // bundled - // informer plugin (./rr workers, ./rr workers -i) - &informer.Plugin{}, - // resetter plugin (./rr reset) - &resetter.Plugin{}, - - // logger plugin - &logger.ZapLogger{}, - // metrics plugin - &metrics.Plugin{}, - // reload plugin - &reload.Plugin{}, - // rpc plugin (workers, reset) - &rpcPlugin.Plugin{}, - // server plugin (NewWorker, NewWorkerPool) - &server.Plugin{}, - // service plugin - &service.Plugin{}, - - // ========= JOBS bundle - &jobs.Plugin{}, - &amqp.Plugin{}, - &sqs.Plugin{}, - &nats.Plugin{}, - &beanstalk.Plugin{}, - // ========= - - // http server plugin with middleware - &httpPlugin.Plugin{}, - &newrelic.Plugin{}, - &static.Plugin{}, - &headers.Plugin{}, - &status.Plugin{}, - &gzip.Plugin{}, - &prometheus.Plugin{}, - - &fileserver.Plugin{}, - // =================== - - &grpcPlugin.Plugin{}, - // kv + ws + jobs plugin - &memory.Plugin{}, - // KV + Jobs - &boltdb.Plugin{}, - - // broadcast via memory or redis - // used in conjunction with Websockets, memory and redis plugins - &broadcast.Plugin{}, - // ======== websockets broadcast bundle - &websockets.Plugin{}, - &redis.Plugin{}, - // ========= - - // ============== KV - &kv.Plugin{}, - &memcached.Plugin{}, - // ============== - - // raw TCP connections handling - &tcp.Plugin{}, - - // temporal plugins - &roadrunner_temporal.Plugin{}, - } +func Plugins() []interface{} { + return []interface{}{} } diff --git a/internal/container/plugins_test.go b/internal/container/plugins_test.go deleted file mode 100644 index da639f7d..00000000 --- a/internal/container/plugins_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package container_test - -import ( - "reflect" - "testing" - - "github.com/spiral/roadrunner-binary/v2/internal/container" -) - -func TestPlugins(t *testing.T) { - for _, p := range container.Plugins() { - if p == nil { - t.Error("plugin cannot be nil") - } - - if pk := reflect.TypeOf(p).Kind(); pk != reflect.Ptr && pk != reflect.Struct { - t.Errorf("plugin %v must be a structure or pointer to the structure", p) - } - } -} diff --git a/internal/debug/server_test.go b/internal/debug/server_test.go index d2e1f9f0..37df0636 100644 --- a/internal/debug/server_test.go +++ b/internal/debug/server_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/spiral/roadrunner-binary/v2/internal/debug" + "github.com/roadrunner-server/roadrunner/v2/internal/debug" "github.com/stretchr/testify/assert" ) diff --git a/internal/rpc/client.go b/internal/rpc/client.go index f371a51c..4e58972b 100644 --- a/internal/rpc/client.go +++ b/internal/rpc/client.go @@ -4,10 +4,10 @@ package rpc import ( "net/rpc" - "github.com/spiral/errors" - goridgeRpc "github.com/spiral/goridge/v3/pkg/rpc" - "github.com/spiral/roadrunner-plugins/v2/config" - rpcPlugin "github.com/spiral/roadrunner-plugins/v2/rpc" + "github.com/roadrunner-server/config/v2" + "github.com/roadrunner-server/errors" + goridgeRpc "github.com/roadrunner-server/goridge/v3/pkg/rpc" + rpcPlugin "github.com/roadrunner-server/rpc/v2" ) // NewClient creates client ONLY for internal usage (communication between our application with RR side). diff --git a/internal/rpc/client_test.go b/internal/rpc/client_test.go index b39788a2..34240826 100644 --- a/internal/rpc/client_test.go +++ b/internal/rpc/client_test.go @@ -4,9 +4,9 @@ import ( "net" "testing" - "github.com/spiral/roadrunner-binary/v2/internal/rpc" + "github.com/roadrunner-server/roadrunner/v2/internal/rpc" - "github.com/spiral/roadrunner-plugins/v2/config" + "github.com/roadrunner-server/config/v2" "github.com/stretchr/testify/assert" ) |