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

47 lines
960 B
Go
Raw Normal View History

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)
}