directory/cmd/importer/main.go

53 lines
935 B
Go
Raw Permalink Normal View History

2024-06-01 23:43:00 +00:00
package main
import (
2024-06-15 14:41:37 +00:00
"fmt"
"runtime/debug"
2024-06-01 23:43:00 +00:00
"go.uber.org/fx"
"sneak.berlin/go/directory/internal/config"
"sneak.berlin/go/directory/internal/database"
"sneak.berlin/go/directory/internal/globals"
"sneak.berlin/go/directory/internal/importer"
"sneak.berlin/go/directory/internal/logger"
2024-06-15 14:41:37 +00:00
"sneak.berlin/go/directory/internal/store"
2024-06-01 23:43:00 +00:00
)
var (
Appname string = "importer"
Version string
Buildarch string
)
2024-06-15 14:41:37 +00:00
var Commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
for _, setting := range info.Settings {
if setting.Key == "vcs.revision" {
return setting.Value
}
}
}
return ""
}()
2024-06-01 23:43:00 +00:00
func main() {
2024-06-15 14:41:37 +00:00
fmt.Println("Commit: ", Commit)
2024-06-01 23:43:00 +00:00
globals.Appname = Appname
globals.Version = Version
globals.Buildarch = Buildarch
fx.New(
fx.Provide(
config.New,
database.New,
2024-06-15 14:41:37 +00:00
store.New,
2024-06-01 23:43:00 +00:00
globals.New,
logger.New,
importer.New,
),
fx.Invoke(func(*importer.Importer) {}),
).Run()
}