Files
query-orchestration/cmd/clientSyncRunner/main.go
T
Michael McGuinness 81e7223560 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
2025-04-02 18:50:03 +00:00

49 lines
966 B
Go

// **Listens For**: Body Containing Client ID
//
// **Action**.
//
// Adds an event for each document into the DOCSYNC queue for the given Client.
package main
import (
"context"
"log/slog"
"os"
clientsyncrunner "queryorchestration/api/clientSyncRunner"
clientsync "queryorchestration/internal/client/sync"
"queryorchestration/internal/server/runner"
"queryorchestration/internal/serviceconfig/queue/documentsync"
_ "github.com/lib/pq"
)
type ClientSyncConfig struct {
runner.BaseConfig[clientsyncrunner.Body]
documentsync.DocSyncConfig
}
func main() {
ctx := context.Background()
cfg := &ClientSyncConfig{}
cfg.ControllerFunc = func() runner.Controller[clientsyncrunner.Body] {
svc := clientsync.New(cfg)
c := clientsyncrunner.New(cfg.GetValidator(), &clientsyncrunner.Services{
ClientSync: svc,
})
return &c
}
server, err := runner.New(ctx, cfg)
if err != nil {
slog.Error(err.Error())
os.Exit(1)
}
server.Listen(ctx)
}