Files
query-orchestration/cmd/docCleanRunner/main.go
T

53 lines
1.0 KiB
Go
Raw Normal View History

package main
import (
"context"
"log/slog"
"os"
2025-03-05 12:05:46 +00:00
doccleanrunner "queryorchestration/api/docCleanRunner"
documentclean "queryorchestration/internal/document/clean"
cleanversion "queryorchestration/internal/document/clean/version"
"queryorchestration/internal/server/runner"
2025-02-28 13:11:53 +00:00
"queryorchestration/internal/serviceconfig/objectstore"
"queryorchestration/internal/serviceconfig/queue/documenttext"
_ "github.com/lib/pq"
)
type DocCleanConfig struct {
runner.BaseConfig
documenttext.DocTextConfig
2025-02-28 13:11:53 +00:00
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)
}
2025-02-28 13:11:53 +00:00
err = cfg.SetStoreClient(ctx)
if err != nil {
slog.Error(err.Error())
os.Exit(1)
}
server.Listen(ctx)
}