31 lines
836 B
Go
31 lines
836 B
Go
package demogrpc
|
|
|
|
import (
|
|
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/srv/grpc/opts"
|
|
"google.golang.org/grpc"
|
|
"google.golang.org/grpc/credentials/insecure"
|
|
|
|
demoAppPb "gitea.libretechconsulting.com/rmcguire/go-server-with-otel/api/demo/app/v1alpha1"
|
|
)
|
|
|
|
func (ds *DemoGRPCServer) GetDialOpts() []grpc.DialOption {
|
|
return []grpc.DialOption{
|
|
// NOTE: Necessary for grpc-gateway to connect to grpc server
|
|
// Update if grpc service has credentials, tls, etc..
|
|
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
|
}
|
|
}
|
|
|
|
func (ds *DemoGRPCServer) GetServices() []*opts.GRPCService {
|
|
return []*opts.GRPCService{
|
|
{
|
|
Name: "Demo App",
|
|
Type: &demoAppPb.DemoAppService_ServiceDesc,
|
|
Service: ds,
|
|
GwRegistrationFuncs: []opts.GwRegistrationFunc{
|
|
demoAppPb.RegisterDemoAppServiceHandler,
|
|
},
|
|
},
|
|
}
|
|
}
|