-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
49 lines (45 loc) · 964 Bytes
/
main.go
File metadata and controls
49 lines (45 loc) · 964 Bytes
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
package main
import (
"os"
"github.com/ideagate/core/utils/log"
"github.com/ideagate/server-controller/app/grpc"
"github.com/ideagate/server-controller/app/migration"
"github.com/urfave/cli/v2"
)
func main() {
app := cli.App{
Name: "Server Controller",
Commands: []*cli.Command{
{
Name: "start",
Usage: "start grpc server",
Action: grpc.Action,
},
{
Name: "migrate",
Usage: "migrate the database schema",
Subcommands: []*cli.Command{
{
Name: "create",
Usage: migration.ActionCreateUsage,
Flags: migration.ActionCreateFlags,
Action: migration.ActionCreate,
},
{
Name: "up",
Usage: "run the migration files",
Action: migration.ActionUp,
},
{
Name: "down",
Usage: "rollback the migration",
Action: migration.ActionDown,
},
},
},
},
}
if err := app.Run(os.Args); err != nil {
log.Fatal(err.Error())
}
}