package main import ( "context" "log/slog" "os" doccleanrunner "queryorchestration/api/docCleanRunner" documentclean "queryorchestration/internal/document/clean" cleanversion "queryorchestration/internal/document/clean/version" "queryorchestration/internal/server/runner" "queryorchestration/internal/serviceconfig/objectstore" "queryorchestration/internal/serviceconfig/queue/documenttext" _ "github.com/lib/pq" ) type DocCleanConfig struct { runner.BaseConfig documenttext.DocTextConfig objectstore.ObjectStoreConfig } func main() { ctx := context.Background() cfg := &DocCleanConfig{} cfg.ControllerFunc = func() runner.Controller { clean := documentclean.New(cfg, &documentclean.Services{ Version: cleanversion.New(cfg), }) return doccleanrunner.New(cfg.GetValidator(), &doccleanrunner.Services{ Clean: clean, }) } server, err := runner.New(ctx, cfg) if err != nil { slog.Error(err.Error()) os.Exit(1) } err = cfg.SetStoreClient(ctx) if err != nil { slog.Error(err.Error()) os.Exit(1) } server.Listen(ctx) }