-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
45 lines (39 loc) · 861 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
37
38
39
40
41
42
43
44
45
package main
import (
"log"
"os"
"github.com/muhammadisa/go-mq-boilerplate/mq"
"github.com/muhammadisa/gosqlexec"
"github.com/urfave/cli"
)
func main() {
qe := gosqlexec.GoSQLExec{
AlterQuery: "db/alter/alter_tables.sql",
DropQuery: "db/drop/drop_tables.sql",
CustomQuery: "db/query/custom_query.sql",
Schemas: []string{
"db/schemas/foobars.sql",
},
}
app := cli.NewApp()
app.Name = "Message Broker Service"
app.Usage = "Message broker service CLI tools"
app.Commands = []cli.Command{
gosqlexec.MigrateCommand(qe),
gosqlexec.DropTablesCommand(qe),
gosqlexec.AlterTablesCommand(qe),
gosqlexec.CustomQueryExecCommand(qe),
{
Name: "run-server",
Usage: "Start Server",
Action: func(c *cli.Context) error {
mq.Run()
return nil
},
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}