Use google.golang.org/protobuf instead of github.com/gogo/protobuf

This change replaces github.com/gogo/protobuf with
google.golang.org/protobuf, except for the code generators.

All proto-encoded structs are now generated from .proto files,
which include ttrpc.Request and ttrpc.Response.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
Kazuyoshi Kato
2022-02-16 22:32:47 +00:00
parent 332f4c9a9b
commit d240c5005f
20 changed files with 1011 additions and 955 deletions

View File

@@ -26,7 +26,7 @@ import (
ttrpc "github.com/containerd/ttrpc"
"github.com/containerd/ttrpc/example"
"github.com/gogo/protobuf/types"
"google.golang.org/protobuf/types/known/emptypb"
)
const socket = "example-ttrpc-server"
@@ -130,6 +130,6 @@ func (s *exampleServer) Method1(ctx context.Context, r *example.Method1Request)
}, nil
}
func (s *exampleServer) Method2(ctx context.Context, r *example.Method1Request) (*types.Empty, error) {
return &types.Empty{}, nil
func (s *exampleServer) Method2(ctx context.Context, r *example.Method1Request) (*emptypb.Empty, error) {
return &emptypb.Empty{}, nil
}