generated from rmcguire/go-server-with-otel
implement class logo
This commit is contained in:
30
pkg/classgrpc/server.go
Normal file
30
pkg/classgrpc/server.go
Normal file
@ -0,0 +1,30 @@
|
||||
package classgrpc
|
||||
|
||||
import (
|
||||
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/srv/grpc/opts"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
|
||||
class "gitea.libretechconsulting.com/rmcguire/class-server/api/class/v1alpha1"
|
||||
)
|
||||
|
||||
func (s *ClassService) 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 (s *ClassService) GetServices() []*opts.GRPCService {
|
||||
return []*opts.GRPCService{
|
||||
{
|
||||
Name: "Class App",
|
||||
Type: &class.ClassService_ServiceDesc,
|
||||
Service: s,
|
||||
GwRegistrationFuncs: []opts.GwRegistrationFunc{
|
||||
class.RegisterClassServiceHandler,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user