-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
36 lines (31 loc) · 816 Bytes
/
main.go
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
package main
import (
"flag"
"fmt"
"github.com/bethel-nz/goxeca/cmd/xeca"
"github.com/bethel-nz/goxeca/pkg/goxeca"
"github.com/charmbracelet/log"
)
func main() {
fmt.Println("Starting GoXeca...")
mode := flag.String("mode", "cli", "Mode to run the application (cli or web)")
flag.Parse()
config := goxeca.ManagerConfig{
MaxConcurrent: 20,
RedisAddr: "localhost:6379", // <- ideally, you should store this in a .env file and read it
RedisPassword: "", // <- same for this
RedisDB: 1, // <- and this too
JobQueueSize: 100,
}
manager := goxeca.NewManager(config)
manager.Start()
defer manager.Stop()
switch *mode {
case "cli":
xeca.RunCLI(manager)
case "web":
xeca.RunWeb(manager)
default:
log.Fatal("Invalid mode. Use 'cli' or 'web'")
}
}