added template for new golang backend

This commit is contained in:
2022-11-13 19:17:07 +01:00
parent bd11d7973c
commit 0e58a5c5f0
36 changed files with 2908 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
package main
import (
scn "blackforestbytes.com/simplecloudnotifier"
"blackforestbytes.com/simplecloudnotifier/api"
"blackforestbytes.com/simplecloudnotifier/common"
"blackforestbytes.com/simplecloudnotifier/common/ginext"
"blackforestbytes.com/simplecloudnotifier/db"
"blackforestbytes.com/simplecloudnotifier/logic"
"fmt"
"github.com/rs/zerolog/log"
)
var conf = scn.Conf
func main() {
common.Init(conf)
log.Info().Msg(fmt.Sprintf("Starting with config-namespace <%s>", conf.Namespace))
sqlite, err := db.NewDatabase(conf)
if err != nil {
panic(err)
}
app := logic.NewApp(sqlite)
ginengine := ginext.NewEngine(conf)
router := api.NewRouter(app)
app.Init(conf, ginengine)
router.Init(ginengine)
app.Run()
}