25 lines
573 B
Go
25 lines
573 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
|
|
pb "github.com/helloworlde/grpc-gateway/proto/api"
|
|
)
|
|
|
|
type HelloService struct {
|
|
pb.UnimplementedHelloServiceServer
|
|
}
|
|
|
|
// mustEmbedUnimplementedHelloServiceServer implements grpc_gateway.HelloServiceServer.
|
|
func (*HelloService) mustEmbedUnimplementedHelloServiceServer() {
|
|
panic("unimplemented")
|
|
}
|
|
|
|
func (h *HelloService) Hello(ctx context.Context, message *pb.HelloMessage) (*pb.HelloResponse, error) {
|
|
helloMessage := "Hello " + message.GetMessage()
|
|
|
|
response := pb.HelloResponse{Result: helloMessage}
|
|
|
|
return &response, nil
|
|
}
|