summaryrefslogtreecommitdiff
path: root/cmd/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/main.go')
-rw-r--r--cmd/main.go58
1 files changed, 58 insertions, 0 deletions
diff --git a/cmd/main.go b/cmd/main.go
new file mode 100644
index 00000000..56422e82
--- /dev/null
+++ b/cmd/main.go
@@ -0,0 +1,58 @@
+package main
+
+import (
+ "log"
+
+ "github.com/spiral/endure"
+ "github.com/spiral/roadrunner/v2/cmd/cli"
+ "github.com/spiral/roadrunner/v2/plugins/http"
+ "github.com/spiral/roadrunner/v2/plugins/informer"
+
+ "github.com/spiral/roadrunner/v2/plugins/kv/memcached"
+ "github.com/spiral/roadrunner/v2/plugins/kv/memory"
+ "github.com/spiral/roadrunner/v2/plugins/logger"
+ "github.com/spiral/roadrunner/v2/plugins/metrics"
+ "github.com/spiral/roadrunner/v2/plugins/redis"
+ "github.com/spiral/roadrunner/v2/plugins/reload"
+ "github.com/spiral/roadrunner/v2/plugins/resetter"
+ "github.com/spiral/roadrunner/v2/plugins/rpc"
+ "github.com/spiral/roadrunner/v2/plugins/server"
+)
+
+func main() {
+ var err error
+ cli.Container, err = endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel), endure.RetryOnFail(false))
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ err = cli.Container.RegisterAll(
+ // logger plugin
+ &logger.ZapLogger{},
+ // metrics plugin
+ &metrics.Plugin{},
+ // redis plugin (internal)
+ &redis.Plugin{},
+ // http server plugin
+ &http.Plugin{},
+ // reload plugin
+ &reload.Plugin{},
+ // informer plugin (./rr workers, ./rr workers -i)
+ &informer.Plugin{},
+ // resetter plugin (./rr reset)
+ &resetter.Plugin{},
+ // rpc plugin (workers, reset)
+ &rpc.Plugin{},
+ // server plugin (NewWorker, NewWorkerPool)
+ &server.Plugin{},
+ // memcached kv plugin
+ &memcached.Plugin{},
+ // in-memory kv plugin
+ &memory.Plugin{},
+ )
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ cli.Execute()
+}