This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
plug-sdk/cmd/main.go
2024-02-20 11:26:39 +01:00

38 lines
841 B
Go

package main
import (
"context"
"git.dragse.it/anthrove/plug-template/config"
"git.dragse.it/anthrove/plug-template/internal/database/graph"
"git.dragse.it/anthrove/plug-template/internal/utils"
log "github.com/sirupsen/logrus"
)
// cfg holds the orchestrator configuration
var cfg config.PlugConfig
// init is used to load the orchestrator configuration
func init() {
// Load the orchestrator configuration
localCfg, err := config.LoadConfig(cfg)
if err != nil {
log.Panic(err)
}
cfg = localCfg
}
func main() {
// ctx is the root context for the main function
var ctx = context.Background()
// Set up the logger based on the configuration
utils.SetupLogger(cfg.LogLevel, cfg.LogFormat)
// Connect to the graph database
_, err := graph.ConnectToGraphDatabase(ctx)
if err != nil {
log.Panicf("main: %v", err)
}
}