add grpc support

This commit is contained in:
2025-03-07 15:19:05 -05:00
parent 2cf15a4837
commit 00c8e2e4fc
8 changed files with 95 additions and 68 deletions

View File

@ -1,11 +1,26 @@
package opts
import (
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/app"
"google.golang.org/grpc"
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/config"
)
type GRPCOpts struct {
*config.GRPCConfig
*app.AppGRPC
*AppGRPC
}
type AppGRPC struct {
Services []*GRPCService
UnaryInterceptors []grpc.UnaryServerInterceptor
StreamInterceptors []grpc.StreamServerInterceptor
GRPCOpts []grpc.ServerOption
GRPCDone <-chan error
}
type GRPCService struct {
Name string // Descriptive name of service
Type *grpc.ServiceDesc // Type (from protoc generated code)
Service any // Implementation of GRPCService.Type (ptr)
}