Merged in feature/textextraction (pull request #110)

Text Extraction

* bases

* go

* splitting

* structure

* movetoasync

* movetoasync

* settinguptrigger

* reorder

* storevent

* standardisepollingvalidation

* unittests

* fixlint

* fixlint

* awscfg

* generatesample

* followthrough

* tests

* clena

* store

* externalidcleanup

* clientid

* local

* baseunittests

* putobjecttests

* tests
This commit is contained in:
Michael McGuinness
2025-04-02 18:50:03 +00:00
parent e6a4cb3990
commit 81e7223560
226 changed files with 17283 additions and 2744 deletions
+66
View File
@@ -0,0 +1,66 @@
// **Listens For**: Body Containing Textract Result Document Metadata
//
// **Action**.
//
// Process textract output.
//
// An event with the document id is pushed to the QUERYSYNC queue.
package main
import (
"context"
"log/slog"
"os"
doctextprocessrunner "queryorchestration/api/docTextProcessRunner"
documenttext "queryorchestration/internal/document/text"
"queryorchestration/internal/server/runner"
"queryorchestration/internal/serviceconfig/aws"
"queryorchestration/internal/serviceconfig/objectstore"
"queryorchestration/internal/serviceconfig/queue/querysync"
"queryorchestration/internal/serviceconfig/textract"
_ "github.com/lib/pq"
)
type DocTextProcessConfig struct {
runner.BaseConfig[doctextprocessrunner.Body]
aws.AWSConfig
textract.TextractConfig
querysync.QuerySyncConfig
objectstore.ObjectStoreConfig
}
func main() {
ctx := context.Background()
cfg := &DocTextProcessConfig{}
cfg.ControllerFunc = func() runner.Controller[doctextprocessrunner.Body] {
text := documenttext.New(cfg)
return doctextprocessrunner.New(cfg.GetValidator(), &doctextprocessrunner.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)
}