-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
41 lines (34 loc) · 903 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
package main
import (
"fmt"
"os"
"strings"
"github.com/cjlapao/common-go/helper"
"github.com/cjlapao/common-go/log"
"github.com/cjlapao/common-go/version"
"github.com/cjlapao/restapi-testapp-go/controller"
"github.com/cjlapao/restapi-testapp-go/startup"
)
var startupSvc = startup.CreateProvider()
var logger = log.Get()
var versionSvc = version.Get()
func main() {
versionSvc.Minor = 1
getVersion := helper.GetFlagSwitch("version", false)
if getVersion {
format := helper.GetFlagValue("o", "json")
switch strings.ToLower(format) {
case "json":
fmt.Println(versionSvc.PrintVersion(int(version.JSON)))
case "yaml":
fmt.Println(versionSvc.PrintVersion(int(version.JSON)))
default:
fmt.Println("Please choose a valid format, this can be either json or yaml")
}
os.Exit(0)
}
versionSvc.PrintAnsiHeader()
defer func() {
}()
controller.RestApiModuleProcessor()
}