4ccb980593
Initial Job Collector (changes pending) * movearroundtocleancollector * internalgetfunctions * completecollectorquery * simplify * fixtests * addvendor * noplaceholder
33 lines
678 B
Go
33 lines
678 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
controllers "queryorchestration/api/queryRunner"
|
|
"queryorchestration/internal/job/collector"
|
|
"queryorchestration/internal/query/document"
|
|
"queryorchestration/internal/server"
|
|
"queryorchestration/internal/server/queue"
|
|
|
|
_ "github.com/lib/pq"
|
|
)
|
|
|
|
func main() {
|
|
ctx := context.Background()
|
|
|
|
queryrunner := func(cfg *server.Config) queue.Controller {
|
|
coll := collector.New(cfg.Database)
|
|
|
|
svc := document.New(cfg.Database, &document.Services{
|
|
Collector: coll,
|
|
})
|
|
|
|
return controllers.NewQueryRunner(svc, cfg.Validator)
|
|
}
|
|
|
|
server := queue.NewServer(ctx, &queue.ListenerConfig{
|
|
Controller: queryrunner,
|
|
})
|
|
|
|
server.Listen(ctx)
|
|
}
|