-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.go
71 lines (65 loc) · 2.04 KB
/
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
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
70
71
// Copyright (c) 2022 Wireleap
package main
import (
"os"
"github.com/wireleap/common/api/interfaces/clientrelay"
"github.com/wireleap/common/api/interfaces/relaycontract"
"github.com/wireleap/common/api/interfaces/relaydir"
"github.com/wireleap/common/api/interfaces/relayrelay"
"github.com/wireleap/common/cli"
"github.com/wireleap/common/cli/commonsub/commonlib"
"github.com/wireleap/common/cli/commonsub/migratecmd"
"github.com/wireleap/common/cli/commonsub/reloadcmd"
"github.com/wireleap/common/cli/commonsub/restartcmd"
"github.com/wireleap/common/cli/commonsub/rollbackcmd"
"github.com/wireleap/common/cli/commonsub/statuscmd"
"github.com/wireleap/common/cli/commonsub/stopcmd"
"github.com/wireleap/common/cli/commonsub/superviseupgradecmd"
"github.com/wireleap/common/cli/commonsub/upgradecmd"
"github.com/wireleap/common/cli/commonsub/versioncmd"
"github.com/wireleap/common/cli/upgrade"
"github.com/wireleap/relay/sub/balancecmd"
"github.com/wireleap/relay/sub/checkconfigcmd"
"github.com/wireleap/relay/sub/initcmd"
"github.com/wireleap/relay/sub/startcmd"
"github.com/wireleap/relay/sub/withdrawcmd"
"github.com/wireleap/relay/version"
)
const binname = "wireleap-relay"
func main() {
cli.CLI{
Subcmds: []*cli.Subcmd{
initcmd.Cmd,
startcmd.Cmd(),
stopcmd.Cmd(binname),
restartcmd.Cmd(binname, startcmd.Cmd().Run, stopcmd.Cmd(binname).Run),
reloadcmd.Cmd(binname),
statuscmd.Cmd(binname),
upgradecmd.Cmd(
binname,
upgrade.ExecutorSupervised,
version.VERSION,
version.LatestChannelVersion,
),
superviseupgradecmd.Cmd(commonlib.Context{
BinName: binname,
NewVersion: version.VERSION,
}),
migratecmd.Cmd(binname, version.MIGRATIONS, version.VERSION),
rollbackcmd.Cmd(commonlib.Context{
BinName: binname,
PostHook: version.PostRollbackHook,
}),
checkconfigcmd.Cmd,
balancecmd.Cmd(),
withdrawcmd.Cmd(),
versioncmd.Cmd(
&version.VERSION,
relaycontract.T,
relaydir.T,
relayrelay.T,
clientrelay.T,
),
},
}.Parse(os.Args).Run(cli.Home())
}