diff options
author | Valery Piashchynski <[email protected]> | 2020-12-24 11:05:00 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-24 11:05:00 +0300 |
commit | 439c93225d7a9ebaf7cbf1010a54594b906f7d54 (patch) | |
tree | adc7d78e28a9512cb1b1ba85cb4f19dec7d1323d /cmd/main.go | |
parent | 40b6c3169931a3fef62b649db19ff01dc685b7d4 (diff) | |
parent | 62ee1770cc233328300438ffd690ea1d8fc747bb (diff) |
Merge pull request #462 from spiral/feature/CLIv2.0.0-alpha29
feature/CLI
Diffstat (limited to 'cmd/main.go')
-rw-r--r-- | cmd/main.go | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/cmd/main.go b/cmd/main.go new file mode 100644 index 00000000..8151d4fe --- /dev/null +++ b/cmd/main.go @@ -0,0 +1,51 @@ +package main + +import ( + "log" + + "github.com/spiral/endure" + "github.com/spiral/roadrunner-plugins/http" + "github.com/spiral/roadrunner-plugins/informer" + "github.com/spiral/roadrunner-plugins/logger" + "github.com/spiral/roadrunner-plugins/metrics" + "github.com/spiral/roadrunner-plugins/redis" + "github.com/spiral/roadrunner-plugins/reload" + "github.com/spiral/roadrunner-plugins/resetter" + "github.com/spiral/roadrunner-plugins/rpc" + "github.com/spiral/roadrunner-plugins/server" + "github.com/spiral/roadrunner/v2/cmd/cli" +) + +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) + &informer.Plugin{}, + // resetter plugin (./rr reset) + &resetter.Plugin{}, + // rpc plugin (workers, reset) + &rpc.Plugin{}, + // server plugin (NewWorker, NewWorkerPool) + &server.Plugin{}, + ) + if err != nil { + log.Fatal(err) + } + + cli.Execute() +} |