Files
query-orchestration/cmd/docTextRunner/main.go
T
Jay Brown 0ddae4f91e Merged in feature/remove-query (pull request #201)
remove query from codebase part 1

* remove query

* fix localstack run
2026-01-14 17:59:04 +00:00

68 lines
1.5 KiB
Go

// **Listens For**: Body Containing Document ID
//
// **Action**.
//
// If the document text is not already extracted according to the collector standards, trigger the textract job for text detection.
//
// This is the terminal step in the document processing pipeline.
// Query processing has been removed - pipeline ends after text extraction.
package main
import (
"context"
"log/slog"
"os"
doctextrunner "queryorchestration/api/docTextRunner"
documenttext "queryorchestration/internal/document/text"
"queryorchestration/internal/server/runner"
"queryorchestration/internal/serviceconfig/build"
"queryorchestration/internal/serviceconfig/objectstore"
"queryorchestration/internal/serviceconfig/textract"
_ "github.com/lib/pq"
)
type DocTextConfig struct {
runner.BaseConfig[doctextrunner.Body]
textract.TextractConfig
objectstore.ObjectStoreConfig
}
func main() {
// Print version information before any environment checks
build.PrintVersionInfo("docTextRunner")
ctx := context.Background()
cfg := &DocTextConfig{}
cfg.ControllerFunc = func() runner.Controller[doctextrunner.Body] {
text := documenttext.New(cfg)
return doctextrunner.New(&doctextrunner.Services{
Text: text,
})
}
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)
}
err = cfg.SetTextractClient(ctx)
if err != nil {
slog.Error(err.Error())
os.Exit(1)
}
server.Listen(ctx)
}