fix git err

This commit is contained in:
finlab
2021-01-16 16:28:32 +08:00
committed by huan li
parent 65c0f57363
commit 3544aa459d
27 changed files with 31 additions and 3807 deletions

View File

@@ -2,20 +2,17 @@
package main
import (
"context"
"net"
pb "github.com/esinio/geco/gen/service/echo/v1"
"github.com/golang/protobuf/ptypes"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
pb "github.com/esinio/geco/gen/proto/echo/v1"
srv "github.com/esinio/geco/service/echo/v1"
)
func main() {
s := grpc.NewServer()
pb.RegisterEchoServiceServer(s, &service{})
pb.RegisterEchoServiceServer(s, srv.NewService())
lis, err := net.Listen("tcp", ":9090")
if err != nil {
panic(err)
@@ -28,20 +25,3 @@ func main() {
panic(err)
}
}
// UnimplementedEchoServiceServer must be embedded to have forward compatible implementations.
type service struct {
pb.UnimplementedEchoServiceServer
}
func (s *service) Echo(ctx context.Context, req *pb.StringMessage) (*pb.StringMessage, error) {
if req.Value == "" {
return nil, status.Errorf(codes.Unimplemented, "value is empty")
}
return &pb.StringMessage{
Value: req.Value,
Timestamp: ptypes.TimestampNow(),
}, nil
}
// func (s *service) mustEmbedUnimplementedEchoServiceServer() {}