summaryrefslogtreecommitdiff
path: root/cmd/main.go
blob: 8074f316e5f5beba7945bf898ce813672ca0e3f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package main

import (
	"log"

	endure "github.com/spiral/endure/pkg/container"
	"github.com/spiral/roadrunner/v2/cmd/cli"
	httpPlugin "github.com/spiral/roadrunner/v2/plugins/http"
	"github.com/spiral/roadrunner/v2/plugins/informer"
	"github.com/spiral/roadrunner/v2/plugins/temporal/activity"
	temporalClient "github.com/spiral/roadrunner/v2/plugins/temporal/client"
	"github.com/spiral/roadrunner/v2/plugins/temporal/workflow"

	"github.com/spiral/roadrunner/v2/plugins/kv/boltdb"
	"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
		&httpPlugin.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{},
		// boltdb driver
		&boltdb.Plugin{},

		// temporal plugins
		&temporalClient.Plugin{},
		&activity.Plugin{},
		&workflow.Plugin{},
	)
	if err != nil {
		log.Fatal(err)
	}

	cli.Execute()
}