Files
query-orchestration/cmd/clientSyncRunner/main.go
T

49 lines
920 B
Go
Raw Normal View History

// **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"
2025-03-05 12:05:46 +00:00
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
documentsync.DocSyncConfig
}
func main() {
ctx := context.Background()
cfg := &ClientSyncConfig{}
cfg.ControllerFunc = func() runner.Controller {
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)
}