-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
50 lines (42 loc) · 1.14 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
package main
import (
"fmt"
"github.com/ItsNotGoodName/reciva-web-remote/cmd"
"github.com/ItsNotGoodName/reciva-web-remote/config"
"github.com/ItsNotGoodName/reciva-web-remote/internal/build"
"github.com/ItsNotGoodName/reciva-web-remote/internal/model"
)
var (
builtBy = "unknown"
commit = ""
date = ""
releaseURL = ""
summary = "dev"
version = "dev"
)
//go:generate swag fmt -d http,internal/state
//go:generate swag init -g api.go -d http,internal/model,internal/state,internal/pubsub --outputTypes go,json --output ./docs/swagger
//go:generate npm run swag --prefix web
func main() {
// Create config
cfg := config.NewConfig(config.WithFlag)
// Show version and exit
if cfg.ShowVersion {
fmt.Println(version)
return
}
// Show info and exit
if cfg.ShowInfo {
fmt.Printf("Version: %s\nCommit: %s\nDate: %s\nBuilt by: %s\nRelease url: %s\nSummary: %s\n", version, commit, date, builtBy, releaseURL, summary)
return
}
build.CurrentBuild = model.Build{
BuiltBy: builtBy,
Commit: commit,
Date: date,
ReleaseURL: releaseURL,
Summary: summary,
Version: version,
}
cmd.Server(cfg)
}