// **Listens For**: Body Containing Document ID. // // **Action**. // // If the document is not already clean according to the collector standards, a clean is triggered. // // An event with the document id is pushed to the DOCTEXT queue. package main import ( "context" "log/slog" "os" doccleanrunner "queryorchestration/api/docCleanRunner" documentclean "queryorchestration/internal/document/clean" "queryorchestration/internal/server/runner" "queryorchestration/internal/serviceconfig/objectstore" "queryorchestration/internal/serviceconfig/queue/documenttext" _ "github.com/lib/pq" ) type DocCleanConfig struct { runner.BaseConfig documenttext.DocTextConfig objectstore.ObjectStoreConfig } func main() { ctx := context.Background() cfg := &DocCleanConfig{} cfg.ControllerFunc = func() runner.Controller { clean := documentclean.New(cfg) return doccleanrunner.New(cfg.GetValidator(), &doccleanrunner.Services{ Clean: clean, }) } 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) } server.Listen(ctx) }