// **Listens For**: S3 Event // // **Action**. // // It will identify the type of event and the location of said event, and forward the task accordingly. // // It supports the document initialisation and document text processing stages. Events may be pushed to the DOCINIT queue. package main import ( "context" "log/slog" "os" storeeventrunner "queryorchestration/api/storeEventRunner" documentstore "queryorchestration/internal/document/store" "queryorchestration/internal/server/runner" "queryorchestration/internal/serviceconfig/build" "queryorchestration/internal/serviceconfig/queue/documentinit" _ "github.com/lib/pq" ) type StoreEventConfig struct { runner.BaseConfig[storeeventrunner.S3EventNotification] documentinit.DocInitConfig } func main() { // Print version information before any environment checks build.PrintVersionInfo("storeEventRunner") ctx := context.Background() cfg := &StoreEventConfig{} cfg.ControllerFunc = func() runner.Controller[storeeventrunner.S3EventNotification] { store := documentstore.New(cfg) return storeeventrunner.New(&storeeventrunner.Services{ Store: store, }) } server, err := runner.New(ctx, cfg) if err != nil { slog.Error(err.Error()) os.Exit(1) } server.Listen(ctx) }