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

26 lines
506 B
Go
Raw Normal View History

2024-12-18 18:54:48 +00:00
package main
import (
"context"
2025-01-10 11:12:03 +00:00
controllers "queryorchestration/api/queue"
2024-12-24 17:13:48 +00:00
"queryorchestration/internal/document"
2025-01-10 11:12:03 +00:00
"queryorchestration/internal/queue"
"queryorchestration/internal/server"
2024-12-18 18:54:48 +00:00
)
func main() {
ctx := context.Background()
2025-01-10 11:12:03 +00:00
queryrunner := func(cfg *server.Config) queue.Controller {
svc := document.New(cfg.Database)
2024-12-18 18:54:48 +00:00
2025-01-10 11:12:03 +00:00
return controllers.NewQueryRunner(svc, cfg.Validator)
2024-12-18 18:54:48 +00:00
}
2025-01-10 11:12:03 +00:00
server := queue.NewServer(ctx, &queue.ListenerConfig{
Controller: queryrunner,
})
2024-12-18 18:54:48 +00:00
2025-01-10 11:12:03 +00:00
server.Listen(ctx)
2024-12-18 18:54:48 +00:00
}