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:
@@ -2,9 +2,9 @@
|
||||
//
|
||||
// **Action**.
|
||||
//
|
||||
// If the document text is not already extracted according to the collector standards, the text is extracted.
|
||||
// If the document text is not already extracted according to the collector standards, trigger the textract job for text detection.
|
||||
//
|
||||
// An event with the document id is pushed to the QUERYSYNC queue.
|
||||
// Otherwise, add an event to the QUERYSYNC queue.
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -15,24 +15,26 @@ import (
|
||||
doctextrunner "queryorchestration/api/docTextRunner"
|
||||
documenttext "queryorchestration/internal/document/text"
|
||||
"queryorchestration/internal/server/runner"
|
||||
"queryorchestration/internal/serviceconfig/objectstore"
|
||||
"queryorchestration/internal/serviceconfig/queue/querysync"
|
||||
"queryorchestration/internal/serviceconfig/textract"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
type DocTextConfig struct {
|
||||
runner.BaseConfig
|
||||
querysync.QuerySyncConfig
|
||||
type DocTextTriggerConfig struct {
|
||||
runner.BaseConfig[doctextrunner.Body]
|
||||
textract.TextractConfig
|
||||
querysync.QuerySyncConfig
|
||||
objectstore.ObjectStoreConfig
|
||||
}
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
cfg := &DocTextConfig{}
|
||||
cfg := &DocTextTriggerConfig{}
|
||||
|
||||
cfg.ControllerFunc = func() runner.Controller {
|
||||
cfg.ControllerFunc = func() runner.Controller[doctextrunner.Body] {
|
||||
text := documenttext.New(cfg)
|
||||
|
||||
return doctextrunner.New(cfg.GetValidator(), &doctextrunner.Services{
|
||||
@@ -46,5 +48,11 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
err = cfg.SetTextractClient(ctx)
|
||||
if err != nil {
|
||||
slog.Error(err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
server.Listen(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user