generated from rmcguire/go-server-with-otel
implement econet exporter
This commit is contained in:
@@ -27,14 +27,14 @@ import (
|
||||
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/app"
|
||||
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/otel"
|
||||
|
||||
"gitea.libretechconsulting.com/rmcguire/go-server-with-otel/pkg/config"
|
||||
"gitea.libretechconsulting.com/rmcguire/go-server-with-otel/pkg/demo"
|
||||
"gitea.libretechconsulting.com/rmcguire/go-server-with-otel/pkg/service"
|
||||
"gitea.libretechconsulting.com/rmcguire/econet-exporter/pkg/config"
|
||||
"gitea.libretechconsulting.com/rmcguire/econet-exporter/pkg/econet"
|
||||
"gitea.libretechconsulting.com/rmcguire/econet-exporter/pkg/service"
|
||||
)
|
||||
|
||||
const (
|
||||
terminationGracePeriod = 30 * time.Second
|
||||
appName = "demo-app"
|
||||
appName = "econet-exporter"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -43,7 +43,7 @@ var (
|
||||
// NOTE: At least one service needs to add a dial option
|
||||
// for transport credentials, otherwise you will have to do it here
|
||||
appServices = []service.AppService{
|
||||
&demo.DemoService{},
|
||||
&econet.EconetService{},
|
||||
}
|
||||
|
||||
flagSchema bool
|
||||
@@ -54,9 +54,13 @@ func main() {
|
||||
defer cncl()
|
||||
|
||||
// Load configuration and setup logging. The go-app framework
|
||||
// will handle loading config and environment into our demo
|
||||
// app config struct which embeds app.AooConfig
|
||||
// loads config file + environment into the embedded AppConfig; env
|
||||
// overrides for our custom ServiceConfig fields are the caller's
|
||||
// responsibility, hence the LoadEnv call below.
|
||||
ctx, serviceConfig := app.MustLoadConfigInto(ctx, &config.ServiceConfig{})
|
||||
if err := serviceConfig.LoadEnv(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Print schema if that's all we have to do
|
||||
if flagSchema {
|
||||
|
||||
Reference in New Issue
Block a user