package main import ( "context" "os" "os/signal" "gitea.libretechconsulting.com/rmcguire/go-app/pkg/app" "gitea.libretechconsulting.com/rmcguire/go-app/pkg/srv" "golang.org/x/sys/unix" "gitea.libretechconsulting.com/rmcguire/ambient-weather-local-exporter/pkg/ambient" ) func main() { ctx, cncl := signal.NotifyContext(context.Background(), os.Kill, unix.SIGTERM) defer cncl() ctx = app.MustSetupConfigAndLogging(ctx) aw := ambient.New(ctx) aw.MustInit() awApp := app.App{ AppContext: ctx, HTTP: &app.AppHTTP{ Funcs: []srv.HTTPFunc{ { Path: "/weatherstation/updateweatherstation.php", HandlerFunc: aw.GetWundergroundHandlerFunc(ctx), }, { Path: "/data/report", HandlerFunc: aw.GetAWNHandlerFunc(ctx), }, }, HealthChecks: []srv.HealthCheckFunc{ // TODO: Implement func(ctx context.Context) error { return nil }, }, }, } awApp.MustRun() <-awApp.Done() }