-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (30 loc) · 867 Bytes
/
main.go
File metadata and controls
38 lines (30 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"context"
"flag"
"log/slog"
"os"
"github.com/m4n5ter/another-me/internal"
"github.com/m4n5ter/another-me/internal/mindscape"
"github.com/m4n5ter/another-me/pkg/config"
)
var configFlag = flag.String("c", "config.toml", "config file path")
func main() {
flag.Parse()
parser, err := config.NewParser(*configFlag)
if err != nil {
slog.Error("failed to create config parser", "error", err)
os.Exit(1)
}
var config internal.Config
if err := parser.ParseFile(*configFlag, &config); err != nil {
slog.Error("failed to parse config", "error", err)
os.Exit(1)
}
mindscapeClient := mindscape.NewClient(config.Mindscape)
if err := mindscapeClient.Sentinel.HealthCheck(context.Background()); err != nil {
slog.Error("failed to health check(sentinel)", "error", err)
os.Exit(1)
}
slog.Info("config", "config", config)
}