Files
query-orchestration/cmd/queryRunner/main.go
T
Michael McGuinness 24a038ec3d Merged in feature/doctextstructure (pull request #56)
DocTextRunner Structure

* firstround

* shorttests
2025-02-07 14:15:06 +00:00

49 lines
913 B
Go

package main
import (
"context"
"log/slog"
"os"
controllers "queryorchestration/api/queryRunner"
"queryorchestration/internal/document"
"queryorchestration/internal/job/collector"
"queryorchestration/internal/query"
"queryorchestration/internal/query/result"
"queryorchestration/internal/server/runner"
_ "github.com/lib/pq"
)
func main() {
ctx := context.Background()
cfg := &runner.BaseConfig{}
cfg.ControllerFunc = func() runner.Controller {
doc := document.New(cfg)
col := collector.New(cfg, &collector.Services{
Document: doc,
})
res := result.New(cfg)
svc := query.New(cfg, &query.Services{
Result: res,
Collector: col,
Document: doc,
})
c := controllers.New(cfg.GetValidator(), &controllers.Services{
Query: svc,
})
return &c
}
server, err := runner.New(ctx, cfg)
if err != nil {
slog.Error(err.Error())
os.Exit(1)
}
server.Listen(ctx)
}