Files
query-orchestration/api/docTextRunner/runner.go
T

41 lines
626 B
Go
Raw Normal View History

package doctextrunner
import (
"context"
"log/slog"
2025-03-05 12:05:46 +00:00
documenttext "queryorchestration/internal/document/text"
"github.com/google/uuid"
)
const Name = "docTextRunner"
type Services struct {
Text *documenttext.Service
}
type Runner struct {
svc *Services
}
func New(svc *Services) Runner {
return Runner{
svc: svc,
}
}
type Body struct {
DocumentID uuid.UUID `json:"id" validate:"required,uuid"`
}
func (s Runner) Process(ctx context.Context, body Body) bool {
err := s.svc.Text.Extract(ctx, body.DocumentID)
if err != nil {
slog.Error("unable to process", "error", err)
return false
}
return true
}