implement reference grpc server

This commit is contained in:
2025-03-30 20:19:25 -04:00
parent 4bd50b75b9
commit a69cd3f44c
14 changed files with 202 additions and 27 deletions

View File

@ -20,9 +20,11 @@ import (
"golang.org/x/sys/unix"
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/app"
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/srv/grpc/opts"
optshttp "gitea.libretechconsulting.com/rmcguire/go-app/pkg/srv/http/opts"
"gitea.libretechconsulting.com/rmcguire/go-http-server-with-otel/pkg/config"
"gitea.libretechconsulting.com/rmcguire/go-http-server-with-otel/pkg/demogrpc"
"gitea.libretechconsulting.com/rmcguire/go-http-server-with-otel/pkg/demohttp"
)
@ -47,10 +49,15 @@ func main() {
// Prepare servers
demoHTTP := demohttp.NewDemoHTTPServer(ctx, demoApp)
demoGRPC := demogrpc.NewDemoGRPCServer(ctx, demoApp)
// Prepare app
app := &app.App{
AppContext: ctx,
GRPC: &opts.AppGRPC{
Services: demoGRPC.GetServices(),
GRPCDialOpts: demoGRPC.GetDialOpts(),
},
HTTP: &optshttp.AppHTTP{
Ctx: ctx,
HealthChecks: demoHTTP.GetHealthCheckFuncs(),