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

28 lines
549 B
Go
Raw Normal View History

2024-12-18 18:54:48 +00:00
package main
import (
"context"
2025-01-15 19:45:51 +00:00
controllers "queryorchestration/api/queryRunner"
"queryorchestration/internal/query/document"
2025-01-10 11:12:03 +00:00
"queryorchestration/internal/server"
"queryorchestration/internal/server/queue"
_ "github.com/lib/pq"
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
}