apicontext

This commit is contained in:
Michael McGuinness
2024-12-23 16:01:54 +00:00
parent ce5e566c9e
commit a54a70047b
129 changed files with 1107 additions and 693 deletions
+6 -1
View File
@@ -4,9 +4,12 @@ import (
"context"
"gotemplate/api/grpc/controllers"
"gotemplate/api/grpc/spec"
"gotemplate/internal/collector"
"gotemplate/internal/database"
"gotemplate/internal/database/repository"
"gotemplate/internal/export"
"gotemplate/internal/otel"
"gotemplate/internal/query"
"log"
"net"
"strconv"
@@ -36,7 +39,9 @@ func main() {
db := repository.New(pool)
grpcServer := grpc.NewServer()
spec.RegisterNameServer(grpcServer, controllers.NewNameController(*name.New(ctx, db)))
spec.RegisterQueryServiceServer(grpcServer, controllers.NewQueryController(*query.New(db)))
spec.RegisterExportServiceServer(grpcServer, controllers.NewExportController(*export.New(db)))
spec.RegisterJobCollectorServiceServer(grpcServer, controllers.NewJobCollectorController(*collector.New(db)))
log.Printf("Listening on port %d", port)
if err := grpcServer.Serve(lis); err != nil {
+1 -1
View File
@@ -36,7 +36,7 @@ func main() {
db := repository.New(conn)
controllers := queue.Controllers{
Document: *queue.NewDocumentController(*document.New(ctx, db)),
Document: *queue.NewDocumentController(*document.New(db)),
}
config := queue.Queue{