ente/main.go

35 lines
541 B
Go
Raw Normal View History

package main
2023-09-13 08:51:05 +00:00
import (
"cli-go/cmd"
"cli-go/internal/api"
"cli-go/pkg"
)
func main() {
2023-09-13 08:51:05 +00:00
db, err := pkg.GetDB("ente-cli.db")
if err != nil {
panic(err)
}
ctrl := pkg.ClICtrl{
2023-09-15 10:55:29 +00:00
Client: api.NewClient(api.Params{
Debug: false,
Host: "http://localhost:8080",
}),
2023-09-22 16:15:01 +00:00
DB: db,
CliKey: pkg.GetOrCreateClISecret(),
KeyHolder: pkg.NewKeyHolder(),
2023-09-15 10:55:29 +00:00
}
err = ctrl.Init()
if err != nil {
panic(err)
2023-09-13 08:51:05 +00:00
}
defer func() {
if err := db.Close(); err != nil {
panic(err)
}
}()
cmd.Execute(&ctrl)
2023-09-22 13:47:24 +00:00
//ctrl.StartSync()
}