-
Notifications
You must be signed in to change notification settings - Fork 34
/
main.go
46 lines (38 loc) · 973 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
46
package main
import (
"fmt"
"github.com/octavore/naga/service"
"github.com/ketchuphq/ketchup/admin"
"github.com/ketchuphq/ketchup/db/bolt"
"github.com/ketchuphq/ketchup/server/api"
"github.com/ketchuphq/ketchup/server/backup"
"github.com/ketchuphq/ketchup/server/content"
"github.com/ketchuphq/ketchup/server/tls"
ketchup_version "github.com/ketchuphq/ketchup/server/version"
)
// set by goreleaser
var version = "dev"
type App struct {
Content *content.Module
API *api.Module
Admin *admin.Module
TLS *tls.Module
Backup *backup.Module
// configures backend module
Bolt *bolt.Module
}
func (p *App) Init(c *service.Config) {
c.AddCommand(&service.Command{
Keyword: "version",
ShortUsage: "Print version",
Usage: "Print version",
Run: func(_ *service.CommandContext) {
fmt.Printf("version: %s\n", version)
},
})
}
func main() {
ketchup_version.Set(version)
service.EnvVarName = "KETCHUP_ENV"
service.Run(&App{})
}