Files
query-orchestration/cmd/docCleanRunner/main.go
T
Michael McGuinness 90353d8161 Merged in feature/docclean (pull request #55)
Doc Clean Structure

* outline

* isdocclean

* placeholder for clean log

* versionplustesting

* versionplustesting

* testspassed
2025-02-07 12:12:51 +00:00

47 lines
960 B
Go

package main
import (
"context"
"log/slog"
"os"
doccleanrunner "queryorchestration/api/docCleanRunner"
"queryorchestration/internal/document"
documentclean "queryorchestration/internal/document/clean"
"queryorchestration/internal/server/runner"
"queryorchestration/internal/serviceconfig/objectstore"
"queryorchestration/internal/serviceconfig/queue/documenttext"
_ "github.com/lib/pq"
)
type DocCleanConfig struct {
runner.BaseConfig
objectstore.ObjectStoreConfig
documenttext.DocTextConfig
}
func main() {
ctx := context.Background()
cfg := &DocCleanConfig{}
cfg.ControllerFunc = func() runner.Controller {
doc := document.New(cfg)
clean := documentclean.New(cfg, &documentclean.Services{
Document: doc,
})
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)
}
server.Listen(ctx)
}