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
+50
View File
@@ -0,0 +1,50 @@
package doctextprocessrunner
import (
"context"
"log/slog"
documenttext "queryorchestration/internal/document/text"
"github.com/go-playground/validator/v10"
)
const Name = "docTextProcessRunner"
type Services struct {
Text *documenttext.Service
}
type Runner struct {
validator *validator.Validate
svc *Services
}
func New(validator *validator.Validate, svc *Services) Runner {
return Runner{
validator: validator,
svc: svc,
}
}
type Body struct {
Bucket string `json:"bucket" validate:"required"`
Key string `json:"key" validate:"required"`
Hash string `json:"hash" validate:"required"`
ClientID string `json:"clientId" validate:"required"`
}
func (s Runner) Process(ctx context.Context, body Body) bool {
err := s.svc.Text.Process(ctx, &documenttext.ProcessParams{
Bucket: body.Bucket,
Key: body.Key,
Hash: body.Hash,
ClientID: body.ClientID,
})
if err != nil {
slog.Error("unable to process", "bucket", body.Bucket, "key", body.Key, "hash", body.Hash, "error", err)
return false
}
return true
}