From 4308a4e35ad3f738bf0c4efca169ac606875a303 Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Wed, 4 Mar 2026 23:43:52 -0800 Subject: [PATCH 1/2] Migrate from protobuild to buf Signed-off-by: Kazuyoshi Kato --- Makefile | 33 ++--- Protobuild.toml | 28 ---- buf.gen.yaml | 11 ++ buf.lock | 6 + buf.yaml | 10 ++ example/Protobuild.toml | 19 --- example/buf.gen.yaml | 10 ++ example/buf.yaml | 3 + example/example.pb.go | 137 +++++++++--------- example/example_ttrpc.pb.go | 44 +++--- integration/streaming/test.pb.go | 184 ++++++++++++------------- integration/streaming/test_ttrpc.pb.go | 2 +- internal/test.pb.go | 93 +++++++------ test.proto => internal/test.proto | 0 proto/status.proto | 5 - request.pb.go | 141 ++++++++++--------- request.proto | 4 +- 17 files changed, 349 insertions(+), 381 deletions(-) delete mode 100644 Protobuild.toml create mode 100644 buf.gen.yaml create mode 100644 buf.lock create mode 100644 buf.yaml delete mode 100644 example/Protobuild.toml create mode 100644 example/buf.gen.yaml create mode 100644 example/buf.yaml rename test.proto => internal/test.proto (100%) delete mode 100644 proto/status.proto diff --git a/Makefile b/Makefile index c3a497dca..01d501351 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ TESTFLAGS_PARALLEL ?= 8 # Use this to replace `go test` with, for instance, `gotestsum` GOTEST ?= $(GO) test -.PHONY: clean all AUTHORS build binaries test integration generate protos check-protos coverage ci check help install vendor install-protobuf install-protobuild +.PHONY: clean all AUTHORS build binaries test integration generate protos check-protos coverage ci check help install vendor maintainer-clean .DEFAULT: default # Forcibly set the default goal to all, in case an include above brought in a rule definition. @@ -65,7 +65,7 @@ GOTEST ?= $(GO) test all: binaries -check: proto-fmt ## run all linters +check: ## run all linters @echo "$(WHALE) $@" GOGC=75 golangci-lint run @@ -80,7 +80,8 @@ generate: protos protos: bin/protoc-gen-gogottrpc bin/protoc-gen-go-ttrpc ## generate protobuf @echo "$(WHALE) $@" - @(PATH="${ROOTDIR}/bin:${PATH}" protobuild --quiet ${PACKAGES}) + (cd example && buf generate) + buf generate check-protos: protos ## check if protobufs needs to be generated again @echo "$(WHALE) $@" @@ -88,19 +89,6 @@ check-protos: protos ## check if protobufs needs to be generated again ((git diff | cat) && \ (echo "$(ONI) please run 'make protos' when making changes to proto files" && false)) -check-api-descriptors: protos ## check that protobuf changes aren't present. - @echo "$(WHALE) $@" - @test -z "$$(git status --short | grep ".pb.txt" | tee /dev/stderr)" || \ - ((git diff $$(find . -name '*.pb.txt') | cat) && \ - (echo "$(ONI) please run 'make protos' when making changes to proto files and check-in the generated descriptor file changes" && false)) - -proto-fmt: ## check format of proto files - @echo "$(WHALE) $@" - @test -z "$$(find . -name '*.proto' -type f -exec grep -Hn -e "^ " {} \; | tee /dev/stderr)" || \ - (echo "$(ONI) please indent proto files with tabs only" && false) - @test -z "$$(find . -name '*.proto' -type f -exec grep -Hn "Meta meta = " {} \; | grep -v '(gogoproto.nullable) = false' | tee /dev/stderr)" || \ - (echo "$(ONI) meta fields in proto files must have option (gogoproto.nullable) = false" && false) - build: ## build the go packages @echo "$(WHALE) $@" @$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} ${EXTRA_FLAGS} ${PACKAGES} @@ -117,6 +105,10 @@ benchmark: ## run benchmarks tests @echo "$(WHALE) $@" @$(GO) test ${TESTFLAGS} -bench . -run Benchmark +maintainer-clean: + @echo "$(WHALE) $@" + @find . -name '*.pb.go' -delete + FORCE: define BUILD_BINARY @@ -139,15 +131,6 @@ install: ## install binaries @echo "$(WHALE) $@ $(BINPACKAGES)" @$(GO) install $(BINPACKAGES) -install-protobuf: - @echo "$(WHALE) $@" - @script/install-protobuf - -install-protobuild: - @echo "$(WHALE) $@" - @$(GO) install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 - @$(GO) install github.com/containerd/protobuild@14832ccc41429f5c4f81028e5af08aa233a219cf - coverage: ## generate coverprofiles from the unit tests, except tests that require root @echo "$(WHALE) $@" @rm -f coverage.txt diff --git a/Protobuild.toml b/Protobuild.toml deleted file mode 100644 index 0f6ccbd1e..000000000 --- a/Protobuild.toml +++ /dev/null @@ -1,28 +0,0 @@ -version = "2" -generators = ["go"] - -# Control protoc include paths. Below are usually some good defaults, but feel -# free to try it without them if it works for your project. -[includes] - # Include paths that will be added before all others. Typically, you want to - # treat the root of the project as an include, but this may not be necessary. - before = ["."] - - # Paths that will be added untouched to the end of the includes. We use - # `/usr/local/include` to pickup the common install location of protobuf. - # This is the default. - after = ["/usr/local/include"] - -# This section maps protobuf imports to Go packages. These will become -# `-M` directives in the call to the go protobuf generator. -[packages] - "google/protobuf/any.proto" = "github.com/gogo/protobuf/types" - "proto/status.proto" = "google.golang.org/genproto/googleapis/rpc/status" - -[[overrides]] -# enable ttrpc and disable fieldpath and grpc for the shim -prefixes = ["github.com/containerd/ttrpc/integration/streaming"] -generators = ["go", "go-ttrpc"] - -[overrides.parameters.go-ttrpc] -prefix = "TTRPC" diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 000000000..56f872463 --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,11 @@ +version: v2 +plugins: + - remote: buf.build/protocolbuffers/go:v1.28.1 + out: . + opt: + - paths=source_relative + - local: bin/protoc-gen-go-ttrpc + out: . + opt: + - paths=source_relative + - prefix=TTRPC diff --git a/buf.lock b/buf.lock new file mode 100644 index 000000000..5df8acde6 --- /dev/null +++ b/buf.lock @@ -0,0 +1,6 @@ +# Generated by buf. DO NOT EDIT. +version: v2 +deps: + - name: buf.build/googleapis/googleapis + commit: 004180b77378443887d3b55cabc00384 + digest: b5:e8f475fe3330f31f5fd86ac689093bcd274e19611a09db91f41d637cb9197881ce89882b94d13a58738e53c91c6e4bae7dc1feba85f590164c975a89e25115dc diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 000000000..cf0cc872d --- /dev/null +++ b/buf.yaml @@ -0,0 +1,10 @@ +version: v2 +deps: + # For google/rpc/status.proto + - buf.build/googleapis/googleapis:004180b77378443887d3b55cabc00384 +modules: + - path: . + # example/ has own buf.yaml and buf.gen.yaml to not have + # TTRPC prefix. + excludes: + - example diff --git a/example/Protobuild.toml b/example/Protobuild.toml deleted file mode 100644 index 03ed2edb4..000000000 --- a/example/Protobuild.toml +++ /dev/null @@ -1,19 +0,0 @@ -version = "2" -generators = ["go", "go-ttrpc"] - -# Control protoc include paths. Below are usually some good defaults, but feel -# free to try it without them if it works for your project. -[includes] - # Include paths that will be added before all others. Typically, you want to - # treat the root of the project as an include, but this may not be necessary. - # before = ["./protobuf"] - - # Paths that will be added untouched to the end of the includes. We use - # `/usr/local/include` to pickup the common install location of protobuf. - # This is the default. - after = ["/usr/local/include"] - -# This section maps protobuf imports to Go packages. These will become -# `-M` directives in the call to the go protobuf generator. -[packages] - "google/rpc/status.proto" = "github.com/containerd/containerd/protobuf/google/rpc" diff --git a/example/buf.gen.yaml b/example/buf.gen.yaml new file mode 100644 index 000000000..c554757b4 --- /dev/null +++ b/example/buf.gen.yaml @@ -0,0 +1,10 @@ +version: v2 +plugins: + - remote: buf.build/protocolbuffers/go:v1.28.1 + out: . + opt: + - paths=source_relative + - local: ../bin/protoc-gen-go-ttrpc + out: . + opt: + - paths=source_relative diff --git a/example/buf.yaml b/example/buf.yaml new file mode 100644 index 000000000..b8699818a --- /dev/null +++ b/example/buf.yaml @@ -0,0 +1,3 @@ +version: v2 +modules: + - path: . diff --git a/example/example.pb.go b/example/example.pb.go index 0b9f2280c..c8ce70b86 100644 --- a/example/example.pb.go +++ b/example/example.pb.go @@ -1,15 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.11.4 -// source: github.com/containerd/ttrpc/example/example.proto +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: example.proto package example import ( - empty "github.com/golang/protobuf/ptypes/empty" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" ) @@ -33,7 +33,7 @@ type Method1Request struct { func (x *Method1Request) Reset() { *x = Method1Request{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_example_example_proto_msgTypes[0] + mi := &file_example_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -46,7 +46,7 @@ func (x *Method1Request) String() string { func (*Method1Request) ProtoMessage() {} func (x *Method1Request) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_example_example_proto_msgTypes[0] + mi := &file_example_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -59,7 +59,7 @@ func (x *Method1Request) ProtoReflect() protoreflect.Message { // Deprecated: Use Method1Request.ProtoReflect.Descriptor instead. func (*Method1Request) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_example_example_proto_rawDescGZIP(), []int{0} + return file_example_proto_rawDescGZIP(), []int{0} } func (x *Method1Request) GetFoo() string { @@ -88,7 +88,7 @@ type Method1Response struct { func (x *Method1Response) Reset() { *x = Method1Response{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_example_example_proto_msgTypes[1] + mi := &file_example_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -101,7 +101,7 @@ func (x *Method1Response) String() string { func (*Method1Response) ProtoMessage() {} func (x *Method1Response) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_example_example_proto_msgTypes[1] + mi := &file_example_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -114,7 +114,7 @@ func (x *Method1Response) ProtoReflect() protoreflect.Message { // Deprecated: Use Method1Response.ProtoReflect.Descriptor instead. func (*Method1Response) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_example_example_proto_rawDescGZIP(), []int{1} + return file_example_proto_rawDescGZIP(), []int{1} } func (x *Method1Response) GetFoo() string { @@ -142,7 +142,7 @@ type Method2Request struct { func (x *Method2Request) Reset() { *x = Method2Request{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_example_example_proto_msgTypes[2] + mi := &file_example_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -155,7 +155,7 @@ func (x *Method2Request) String() string { func (*Method2Request) ProtoMessage() {} func (x *Method2Request) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_example_example_proto_msgTypes[2] + mi := &file_example_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -168,7 +168,7 @@ func (x *Method2Request) ProtoReflect() protoreflect.Message { // Deprecated: Use Method2Request.ProtoReflect.Descriptor instead. func (*Method2Request) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_example_example_proto_rawDescGZIP(), []int{2} + return file_example_proto_rawDescGZIP(), []int{2} } func (x *Method2Request) GetAction() string { @@ -178,61 +178,58 @@ func (x *Method2Request) GetAction() string { return "" } -var File_github_com_containerd_ttrpc_example_example_proto protoreflect.FileDescriptor - -var file_github_com_containerd_ttrpc_example_example_proto_rawDesc = []byte{ - 0x0a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x65, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x34, 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x61, 0x72, 0x22, 0x35, 0x0a, 0x0f, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x31, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, - 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, - 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x61, 0x72, 0x22, - 0x28, 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x32, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x9e, 0x01, 0x0a, 0x07, 0x45, 0x78, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x4e, 0x0a, 0x07, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, - 0x12, 0x20, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x32, - 0x12, 0x20, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x3b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, +var File_example_proto protoreflect.FileDescriptor + +var file_example_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x10, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, + 0x31, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x34, + 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, + 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x62, 0x61, 0x72, 0x22, 0x35, 0x0a, 0x0f, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x61, 0x72, 0x22, 0x28, 0x0a, 0x0e, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x32, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x9e, 0x01, 0x0a, 0x07, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x12, 0x4e, 0x0a, 0x07, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x12, 0x20, 0x2e, 0x74, + 0x74, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x43, 0x0a, 0x07, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x32, 0x12, 0x20, 0x2e, 0x74, + 0x74, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x31, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, + 0x74, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3b, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_github_com_containerd_ttrpc_example_example_proto_rawDescOnce sync.Once - file_github_com_containerd_ttrpc_example_example_proto_rawDescData = file_github_com_containerd_ttrpc_example_example_proto_rawDesc + file_example_proto_rawDescOnce sync.Once + file_example_proto_rawDescData = file_example_proto_rawDesc ) -func file_github_com_containerd_ttrpc_example_example_proto_rawDescGZIP() []byte { - file_github_com_containerd_ttrpc_example_example_proto_rawDescOnce.Do(func() { - file_github_com_containerd_ttrpc_example_example_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_ttrpc_example_example_proto_rawDescData) +func file_example_proto_rawDescGZIP() []byte { + file_example_proto_rawDescOnce.Do(func() { + file_example_proto_rawDescData = protoimpl.X.CompressGZIP(file_example_proto_rawDescData) }) - return file_github_com_containerd_ttrpc_example_example_proto_rawDescData + return file_example_proto_rawDescData } -var file_github_com_containerd_ttrpc_example_example_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_github_com_containerd_ttrpc_example_example_proto_goTypes = []interface{}{ +var file_example_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_example_proto_goTypes = []interface{}{ (*Method1Request)(nil), // 0: ttrpc.example.v1.Method1Request (*Method1Response)(nil), // 1: ttrpc.example.v1.Method1Response (*Method2Request)(nil), // 2: ttrpc.example.v1.Method2Request - (*empty.Empty)(nil), // 3: google.protobuf.Empty + (*emptypb.Empty)(nil), // 3: google.protobuf.Empty } -var file_github_com_containerd_ttrpc_example_example_proto_depIdxs = []int32{ +var file_example_proto_depIdxs = []int32{ 0, // 0: ttrpc.example.v1.Example.Method1:input_type -> ttrpc.example.v1.Method1Request 0, // 1: ttrpc.example.v1.Example.Method2:input_type -> ttrpc.example.v1.Method1Request 1, // 2: ttrpc.example.v1.Example.Method1:output_type -> ttrpc.example.v1.Method1Response @@ -244,13 +241,13 @@ var file_github_com_containerd_ttrpc_example_example_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_github_com_containerd_ttrpc_example_example_proto_init() } -func file_github_com_containerd_ttrpc_example_example_proto_init() { - if File_github_com_containerd_ttrpc_example_example_proto != nil { +func init() { file_example_proto_init() } +func file_example_proto_init() { + if File_example_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_github_com_containerd_ttrpc_example_example_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_example_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Method1Request); i { case 0: return &v.state @@ -262,7 +259,7 @@ func file_github_com_containerd_ttrpc_example_example_proto_init() { return nil } } - file_github_com_containerd_ttrpc_example_example_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_example_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Method1Response); i { case 0: return &v.state @@ -274,7 +271,7 @@ func file_github_com_containerd_ttrpc_example_example_proto_init() { return nil } } - file_github_com_containerd_ttrpc_example_example_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_example_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Method2Request); i { case 0: return &v.state @@ -291,18 +288,18 @@ func file_github_com_containerd_ttrpc_example_example_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_ttrpc_example_example_proto_rawDesc, + RawDescriptor: file_example_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_github_com_containerd_ttrpc_example_example_proto_goTypes, - DependencyIndexes: file_github_com_containerd_ttrpc_example_example_proto_depIdxs, - MessageInfos: file_github_com_containerd_ttrpc_example_example_proto_msgTypes, + GoTypes: file_example_proto_goTypes, + DependencyIndexes: file_example_proto_depIdxs, + MessageInfos: file_example_proto_msgTypes, }.Build() - File_github_com_containerd_ttrpc_example_example_proto = out.File - file_github_com_containerd_ttrpc_example_example_proto_rawDesc = nil - file_github_com_containerd_ttrpc_example_example_proto_goTypes = nil - file_github_com_containerd_ttrpc_example_example_proto_depIdxs = nil + File_example_proto = out.File + file_example_proto_rawDesc = nil + file_example_proto_goTypes = nil + file_example_proto_depIdxs = nil } diff --git a/example/example_ttrpc.pb.go b/example/example_ttrpc.pb.go index 92c309547..6ad26e01a 100644 --- a/example/example_ttrpc.pb.go +++ b/example/example_ttrpc.pb.go @@ -1,33 +1,35 @@ // Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/ttrpc/example/example.proto +// source: example.proto package example import ( context "context" ttrpc "github.com/containerd/ttrpc" - empty "github.com/golang/protobuf/ptypes/empty" + emptypb "google.golang.org/protobuf/types/known/emptypb" ) type ExampleService interface { - Method1(ctx context.Context, req *Method1Request) (*Method1Response, error) - Method2(ctx context.Context, req *Method1Request) (*empty.Empty, error) + Method1(context.Context, *Method1Request) (*Method1Response, error) + Method2(context.Context, *Method1Request) (*emptypb.Empty, error) } func RegisterExampleService(srv *ttrpc.Server, svc ExampleService) { - srv.Register("ttrpc.example.v1.Example", map[string]ttrpc.Method{ - "Method1": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req Method1Request - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Method1(ctx, &req) - }, - "Method2": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { - var req Method1Request - if err := unmarshal(&req); err != nil { - return nil, err - } - return svc.Method2(ctx, &req) + srv.RegisterService("ttrpc.example.v1.Example", &ttrpc.ServiceDesc{ + Methods: map[string]ttrpc.Method{ + "Method1": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req Method1Request + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Method1(ctx, &req) + }, + "Method2": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req Method1Request + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Method2(ctx, &req) + }, }, }) } @@ -41,6 +43,7 @@ func NewExampleClient(client *ttrpc.Client) ExampleService { client: client, } } + func (c *exampleClient) Method1(ctx context.Context, req *Method1Request) (*Method1Response, error) { var resp Method1Response if err := c.client.Call(ctx, "ttrpc.example.v1.Example", "Method1", req, &resp); err != nil { @@ -48,8 +51,9 @@ func (c *exampleClient) Method1(ctx context.Context, req *Method1Request) (*Meth } return &resp, nil } -func (c *exampleClient) Method2(ctx context.Context, req *Method1Request) (*empty.Empty, error) { - var resp empty.Empty + +func (c *exampleClient) Method2(ctx context.Context, req *Method1Request) (*emptypb.Empty, error) { + var resp emptypb.Empty if err := c.client.Call(ctx, "ttrpc.example.v1.Example", "Method2", req, &resp); err != nil { return nil, err } diff --git a/integration/streaming/test.pb.go b/integration/streaming/test.pb.go index de76ad596..0589b7893 100644 --- a/integration/streaming/test.pb.go +++ b/integration/streaming/test.pb.go @@ -16,8 +16,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/ttrpc/integration/streaming/test.proto +// protoc (unknown) +// source: integration/streaming/test.proto package streaming @@ -48,7 +48,7 @@ type EchoPayload struct { func (x *EchoPayload) Reset() { *x = EchoPayload{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_integration_streaming_test_proto_msgTypes[0] + mi := &file_integration_streaming_test_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -61,7 +61,7 @@ func (x *EchoPayload) String() string { func (*EchoPayload) ProtoMessage() {} func (x *EchoPayload) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_integration_streaming_test_proto_msgTypes[0] + mi := &file_integration_streaming_test_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -74,7 +74,7 @@ func (x *EchoPayload) ProtoReflect() protoreflect.Message { // Deprecated: Use EchoPayload.ProtoReflect.Descriptor instead. func (*EchoPayload) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDescGZIP(), []int{0} + return file_integration_streaming_test_proto_rawDescGZIP(), []int{0} } func (x *EchoPayload) GetSeq() uint32 { @@ -102,7 +102,7 @@ type Part struct { func (x *Part) Reset() { *x = Part{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_integration_streaming_test_proto_msgTypes[1] + mi := &file_integration_streaming_test_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -115,7 +115,7 @@ func (x *Part) String() string { func (*Part) ProtoMessage() {} func (x *Part) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_integration_streaming_test_proto_msgTypes[1] + mi := &file_integration_streaming_test_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -128,7 +128,7 @@ func (x *Part) ProtoReflect() protoreflect.Message { // Deprecated: Use Part.ProtoReflect.Descriptor instead. func (*Part) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDescGZIP(), []int{1} + return file_integration_streaming_test_proto_rawDescGZIP(), []int{1} } func (x *Part) GetAdd() int32 { @@ -150,7 +150,7 @@ type Sum struct { func (x *Sum) Reset() { *x = Sum{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_integration_streaming_test_proto_msgTypes[2] + mi := &file_integration_streaming_test_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -163,7 +163,7 @@ func (x *Sum) String() string { func (*Sum) ProtoMessage() {} func (x *Sum) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_integration_streaming_test_proto_msgTypes[2] + mi := &file_integration_streaming_test_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -176,7 +176,7 @@ func (x *Sum) ProtoReflect() protoreflect.Message { // Deprecated: Use Sum.ProtoReflect.Descriptor instead. func (*Sum) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDescGZIP(), []int{2} + return file_integration_streaming_test_proto_rawDescGZIP(), []int{2} } func (x *Sum) GetSum() int32 { @@ -193,91 +193,89 @@ func (x *Sum) GetNum() int32 { return 0 } -var File_github_com_containerd_ttrpc_integration_streaming_test_proto protoreflect.FileDescriptor - -var file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDesc = []byte{ - 0x0a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x69, 0x6e, 0x67, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, - 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, - 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x31, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x18, 0x0a, 0x04, 0x50, - 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x64, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x03, 0x61, 0x64, 0x64, 0x22, 0x29, 0x0a, 0x03, 0x53, 0x75, 0x6d, 0x12, 0x10, 0x0a, 0x03, - 0x73, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x12, 0x10, - 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, - 0x32, 0xfa, 0x04, 0x0a, 0x09, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x5a, - 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x28, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, +var File_integration_streaming_test_proto protoreflect.FileDescriptor + +var file_integration_streaming_test_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x1b, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x1a, + 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x31, 0x0a, 0x0b, + 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, + 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x10, 0x0a, + 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, + 0x18, 0x0a, 0x04, 0x50, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x64, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x64, 0x64, 0x22, 0x29, 0x0a, 0x03, 0x53, 0x75, 0x6d, + 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x73, + 0x75, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x6e, 0x75, 0x6d, 0x32, 0xfa, 0x04, 0x0a, 0x09, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, + 0x6e, 0x67, 0x12, 0x5a, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x28, 0x2e, 0x74, 0x74, 0x72, + 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x28, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, + 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, + 0x6e, 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x64, + 0x0a, 0x0a, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x28, 0x2e, 0x74, + 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x28, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x1a, 0x28, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x45, - 0x63, 0x68, 0x6f, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x64, 0x0a, 0x0a, 0x45, 0x63, - 0x68, 0x6f, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x28, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, - 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x1a, 0x28, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, - 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x28, 0x01, 0x30, 0x01, - 0x12, 0x52, 0x0a, 0x09, 0x53, 0x75, 0x6d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x21, 0x2e, - 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x74, - 0x1a, 0x20, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x53, - 0x75, 0x6d, 0x28, 0x01, 0x12, 0x55, 0x0a, 0x0c, 0x44, 0x69, 0x76, 0x69, 0x64, 0x65, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x12, 0x20, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, + 0x28, 0x01, 0x30, 0x01, 0x12, 0x52, 0x0a, 0x09, 0x53, 0x75, 0x6d, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x12, 0x21, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, + 0x50, 0x61, 0x72, 0x74, 0x1a, 0x20, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, - 0x6e, 0x67, 0x2e, 0x53, 0x75, 0x6d, 0x1a, 0x21, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, - 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x30, 0x01, 0x12, 0x4e, 0x0a, 0x08, 0x45, - 0x63, 0x68, 0x6f, 0x4e, 0x75, 0x6c, 0x6c, 0x12, 0x28, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, - 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x28, 0x01, 0x12, 0x56, 0x0a, 0x0e, 0x45, - 0x63, 0x68, 0x6f, 0x4e, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x28, 0x2e, - 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x28, - 0x01, 0x30, 0x01, 0x12, 0x58, 0x0a, 0x12, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x50, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x1a, 0x28, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, + 0x6e, 0x67, 0x2e, 0x53, 0x75, 0x6d, 0x28, 0x01, 0x12, 0x55, 0x0a, 0x0c, 0x44, 0x69, 0x76, 0x69, + 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x20, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, + 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x75, 0x6d, 0x1a, 0x21, 0x2e, 0x74, 0x74, 0x72, + 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x30, 0x01, 0x12, + 0x4e, 0x0a, 0x08, 0x45, 0x63, 0x68, 0x6f, 0x4e, 0x75, 0x6c, 0x6c, 0x12, 0x28, 0x2e, 0x74, 0x74, + 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x28, 0x01, 0x12, + 0x56, 0x0a, 0x0e, 0x45, 0x63, 0x68, 0x6f, 0x4e, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x12, 0x28, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x2e, - 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x30, 0x01, 0x42, 0x3d, 0x5a, - 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, - 0x6e, 0x67, 0x3b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x28, 0x01, 0x30, 0x01, 0x12, 0x58, 0x0a, 0x12, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x28, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x69, 0x6e, + 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x69, 0x6e, 0x67, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x30, + 0x01, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x3b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDescOnce sync.Once - file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDescData = file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDesc + file_integration_streaming_test_proto_rawDescOnce sync.Once + file_integration_streaming_test_proto_rawDescData = file_integration_streaming_test_proto_rawDesc ) -func file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDescGZIP() []byte { - file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDescOnce.Do(func() { - file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDescData) +func file_integration_streaming_test_proto_rawDescGZIP() []byte { + file_integration_streaming_test_proto_rawDescOnce.Do(func() { + file_integration_streaming_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_integration_streaming_test_proto_rawDescData) }) - return file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDescData + return file_integration_streaming_test_proto_rawDescData } -var file_github_com_containerd_ttrpc_integration_streaming_test_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_github_com_containerd_ttrpc_integration_streaming_test_proto_goTypes = []interface{}{ +var file_integration_streaming_test_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_integration_streaming_test_proto_goTypes = []interface{}{ (*EchoPayload)(nil), // 0: ttrpc.integration.streaming.EchoPayload (*Part)(nil), // 1: ttrpc.integration.streaming.Part (*Sum)(nil), // 2: ttrpc.integration.streaming.Sum (*emptypb.Empty)(nil), // 3: google.protobuf.Empty } -var file_github_com_containerd_ttrpc_integration_streaming_test_proto_depIdxs = []int32{ +var file_integration_streaming_test_proto_depIdxs = []int32{ 0, // 0: ttrpc.integration.streaming.Streaming.Echo:input_type -> ttrpc.integration.streaming.EchoPayload 0, // 1: ttrpc.integration.streaming.Streaming.EchoStream:input_type -> ttrpc.integration.streaming.EchoPayload 1, // 2: ttrpc.integration.streaming.Streaming.SumStream:input_type -> ttrpc.integration.streaming.Part @@ -299,13 +297,13 @@ var file_github_com_containerd_ttrpc_integration_streaming_test_proto_depIdxs = 0, // [0:0] is the sub-list for field type_name } -func init() { file_github_com_containerd_ttrpc_integration_streaming_test_proto_init() } -func file_github_com_containerd_ttrpc_integration_streaming_test_proto_init() { - if File_github_com_containerd_ttrpc_integration_streaming_test_proto != nil { +func init() { file_integration_streaming_test_proto_init() } +func file_integration_streaming_test_proto_init() { + if File_integration_streaming_test_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_github_com_containerd_ttrpc_integration_streaming_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_integration_streaming_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EchoPayload); i { case 0: return &v.state @@ -317,7 +315,7 @@ func file_github_com_containerd_ttrpc_integration_streaming_test_proto_init() { return nil } } - file_github_com_containerd_ttrpc_integration_streaming_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_integration_streaming_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Part); i { case 0: return &v.state @@ -329,7 +327,7 @@ func file_github_com_containerd_ttrpc_integration_streaming_test_proto_init() { return nil } } - file_github_com_containerd_ttrpc_integration_streaming_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_integration_streaming_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Sum); i { case 0: return &v.state @@ -346,18 +344,18 @@ func file_github_com_containerd_ttrpc_integration_streaming_test_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDesc, + RawDescriptor: file_integration_streaming_test_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_github_com_containerd_ttrpc_integration_streaming_test_proto_goTypes, - DependencyIndexes: file_github_com_containerd_ttrpc_integration_streaming_test_proto_depIdxs, - MessageInfos: file_github_com_containerd_ttrpc_integration_streaming_test_proto_msgTypes, + GoTypes: file_integration_streaming_test_proto_goTypes, + DependencyIndexes: file_integration_streaming_test_proto_depIdxs, + MessageInfos: file_integration_streaming_test_proto_msgTypes, }.Build() - File_github_com_containerd_ttrpc_integration_streaming_test_proto = out.File - file_github_com_containerd_ttrpc_integration_streaming_test_proto_rawDesc = nil - file_github_com_containerd_ttrpc_integration_streaming_test_proto_goTypes = nil - file_github_com_containerd_ttrpc_integration_streaming_test_proto_depIdxs = nil + File_integration_streaming_test_proto = out.File + file_integration_streaming_test_proto_rawDesc = nil + file_integration_streaming_test_proto_goTypes = nil + file_integration_streaming_test_proto_depIdxs = nil } diff --git a/integration/streaming/test_ttrpc.pb.go b/integration/streaming/test_ttrpc.pb.go index d3fbfce25..e1e1cf10f 100644 --- a/integration/streaming/test_ttrpc.pb.go +++ b/integration/streaming/test_ttrpc.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: github.com/containerd/ttrpc/integration/streaming/test.proto +// source: integration/streaming/test.proto package streaming import ( diff --git a/internal/test.pb.go b/internal/test.pb.go index 8e5a85bf1..0c5ac3345 100644 --- a/internal/test.pb.go +++ b/internal/test.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/ttrpc/test.proto +// protoc (unknown) +// source: internal/test.proto package internal @@ -33,7 +33,7 @@ type TestPayload struct { func (x *TestPayload) Reset() { *x = TestPayload{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_test_proto_msgTypes[0] + mi := &file_internal_test_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -46,7 +46,7 @@ func (x *TestPayload) String() string { func (*TestPayload) ProtoMessage() {} func (x *TestPayload) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_test_proto_msgTypes[0] + mi := &file_internal_test_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -59,7 +59,7 @@ func (x *TestPayload) ProtoReflect() protoreflect.Message { // Deprecated: Use TestPayload.ProtoReflect.Descriptor instead. func (*TestPayload) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_test_proto_rawDescGZIP(), []int{0} + return file_internal_test_proto_rawDescGZIP(), []int{0} } func (x *TestPayload) GetFoo() string { @@ -95,7 +95,7 @@ type EchoPayload struct { func (x *EchoPayload) Reset() { *x = EchoPayload{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_test_proto_msgTypes[1] + mi := &file_internal_test_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -108,7 +108,7 @@ func (x *EchoPayload) String() string { func (*EchoPayload) ProtoMessage() {} func (x *EchoPayload) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_test_proto_msgTypes[1] + mi := &file_internal_test_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -121,7 +121,7 @@ func (x *EchoPayload) ProtoReflect() protoreflect.Message { // Deprecated: Use EchoPayload.ProtoReflect.Descriptor instead. func (*EchoPayload) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_test_proto_rawDescGZIP(), []int{1} + return file_internal_test_proto_rawDescGZIP(), []int{1} } func (x *EchoPayload) GetSeq() int64 { @@ -138,44 +138,43 @@ func (x *EchoPayload) GetMsg() string { return "" } -var File_github_com_containerd_ttrpc_test_proto protoreflect.FileDescriptor +var File_internal_test_proto protoreflect.FileDescriptor -var file_github_com_containerd_ttrpc_test_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x65, - 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x74, 0x72, 0x70, 0x63, 0x22, - 0x57, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x10, - 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, 0x6f, 0x6f, - 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x31, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, 0x26, 0x5a, 0x24, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var file_internal_test_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x74, 0x72, 0x70, 0x63, 0x22, 0x57, 0x0a, 0x0b, + 0x54, 0x65, 0x73, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x66, + 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x1a, 0x0a, + 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x31, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, 0x50, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_github_com_containerd_ttrpc_test_proto_rawDescOnce sync.Once - file_github_com_containerd_ttrpc_test_proto_rawDescData = file_github_com_containerd_ttrpc_test_proto_rawDesc + file_internal_test_proto_rawDescOnce sync.Once + file_internal_test_proto_rawDescData = file_internal_test_proto_rawDesc ) -func file_github_com_containerd_ttrpc_test_proto_rawDescGZIP() []byte { - file_github_com_containerd_ttrpc_test_proto_rawDescOnce.Do(func() { - file_github_com_containerd_ttrpc_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_ttrpc_test_proto_rawDescData) +func file_internal_test_proto_rawDescGZIP() []byte { + file_internal_test_proto_rawDescOnce.Do(func() { + file_internal_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_test_proto_rawDescData) }) - return file_github_com_containerd_ttrpc_test_proto_rawDescData + return file_internal_test_proto_rawDescData } -var file_github_com_containerd_ttrpc_test_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_github_com_containerd_ttrpc_test_proto_goTypes = []interface{}{ +var file_internal_test_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_internal_test_proto_goTypes = []interface{}{ (*TestPayload)(nil), // 0: ttrpc.TestPayload (*EchoPayload)(nil), // 1: ttrpc.EchoPayload } -var file_github_com_containerd_ttrpc_test_proto_depIdxs = []int32{ +var file_internal_test_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -183,13 +182,13 @@ var file_github_com_containerd_ttrpc_test_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_github_com_containerd_ttrpc_test_proto_init() } -func file_github_com_containerd_ttrpc_test_proto_init() { - if File_github_com_containerd_ttrpc_test_proto != nil { +func init() { file_internal_test_proto_init() } +func file_internal_test_proto_init() { + if File_internal_test_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_github_com_containerd_ttrpc_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_internal_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TestPayload); i { case 0: return &v.state @@ -201,7 +200,7 @@ func file_github_com_containerd_ttrpc_test_proto_init() { return nil } } - file_github_com_containerd_ttrpc_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_internal_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EchoPayload); i { case 0: return &v.state @@ -218,18 +217,18 @@ func file_github_com_containerd_ttrpc_test_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_ttrpc_test_proto_rawDesc, + RawDescriptor: file_internal_test_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_github_com_containerd_ttrpc_test_proto_goTypes, - DependencyIndexes: file_github_com_containerd_ttrpc_test_proto_depIdxs, - MessageInfos: file_github_com_containerd_ttrpc_test_proto_msgTypes, + GoTypes: file_internal_test_proto_goTypes, + DependencyIndexes: file_internal_test_proto_depIdxs, + MessageInfos: file_internal_test_proto_msgTypes, }.Build() - File_github_com_containerd_ttrpc_test_proto = out.File - file_github_com_containerd_ttrpc_test_proto_rawDesc = nil - file_github_com_containerd_ttrpc_test_proto_goTypes = nil - file_github_com_containerd_ttrpc_test_proto_depIdxs = nil + File_internal_test_proto = out.File + file_internal_test_proto_rawDesc = nil + file_internal_test_proto_goTypes = nil + file_internal_test_proto_depIdxs = nil } diff --git a/test.proto b/internal/test.proto similarity index 100% rename from test.proto rename to internal/test.proto diff --git a/proto/status.proto b/proto/status.proto deleted file mode 100644 index 4186d4c79..000000000 --- a/proto/status.proto +++ /dev/null @@ -1,5 +0,0 @@ -syntax = "proto3"; - -message Status { - int32 code = 1; -} diff --git a/request.pb.go b/request.pb.go index 3921ae5a3..fe1d749f7 100644 --- a/request.pb.go +++ b/request.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/ttrpc/request.proto +// protoc (unknown) +// source: request.proto package ttrpc @@ -36,7 +36,7 @@ type Request struct { func (x *Request) Reset() { *x = Request{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[0] + mi := &file_request_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -49,7 +49,7 @@ func (x *Request) String() string { func (*Request) ProtoMessage() {} func (x *Request) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[0] + mi := &file_request_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -62,7 +62,7 @@ func (x *Request) ProtoReflect() protoreflect.Message { // Deprecated: Use Request.ProtoReflect.Descriptor instead. func (*Request) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_request_proto_rawDescGZIP(), []int{0} + return file_request_proto_rawDescGZIP(), []int{0} } func (x *Request) GetService() string { @@ -112,7 +112,7 @@ type Response struct { func (x *Response) Reset() { *x = Response{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[1] + mi := &file_request_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -125,7 +125,7 @@ func (x *Response) String() string { func (*Response) ProtoMessage() {} func (x *Response) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[1] + mi := &file_request_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -138,7 +138,7 @@ func (x *Response) ProtoReflect() protoreflect.Message { // Deprecated: Use Response.ProtoReflect.Descriptor instead. func (*Response) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_request_proto_rawDescGZIP(), []int{1} + return file_request_proto_rawDescGZIP(), []int{1} } func (x *Response) GetStatus() *status.Status { @@ -166,7 +166,7 @@ type StringList struct { func (x *StringList) Reset() { *x = StringList{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[2] + mi := &file_request_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -179,7 +179,7 @@ func (x *StringList) String() string { func (*StringList) ProtoMessage() {} func (x *StringList) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[2] + mi := &file_request_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -192,7 +192,7 @@ func (x *StringList) ProtoReflect() protoreflect.Message { // Deprecated: Use StringList.ProtoReflect.Descriptor instead. func (*StringList) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_request_proto_rawDescGZIP(), []int{2} + return file_request_proto_rawDescGZIP(), []int{2} } func (x *StringList) GetList() []string { @@ -214,7 +214,7 @@ type KeyValue struct { func (x *KeyValue) Reset() { *x = KeyValue{} if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[3] + mi := &file_request_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -227,7 +227,7 @@ func (x *KeyValue) String() string { func (*KeyValue) ProtoMessage() {} func (x *KeyValue) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[3] + mi := &file_request_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -240,7 +240,7 @@ func (x *KeyValue) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyValue.ProtoReflect.Descriptor instead. func (*KeyValue) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_request_proto_rawDescGZIP(), []int{3} + return file_request_proto_rawDescGZIP(), []int{3} } func (x *KeyValue) GetKey() string { @@ -257,62 +257,61 @@ func (x *KeyValue) GetValue() string { return "" } -var File_github_com_containerd_ttrpc_request_proto protoreflect.FileDescriptor - -var file_github_com_containerd_ttrpc_request_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x74, 0x72, - 0x70, 0x63, 0x1a, 0x12, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x21, - 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x4e, 0x61, 0x6e, - 0x6f, 0x12, 0x2b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4b, 0x65, 0x79, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x45, - 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x20, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, - 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x32, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x1d, 0x5a, 0x1b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, +var File_request_proto protoreflect.FileDescriptor + +var file_request_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x05, 0x74, 0x74, 0x72, 0x70, 0x63, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, + 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xa5, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x2b, 0x0a, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, + 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x50, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x20, 0x0a, 0x0a, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x32, 0x0a, 0x08, 0x4b, + 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, + 0x1d, 0x5a, 0x1b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_github_com_containerd_ttrpc_request_proto_rawDescOnce sync.Once - file_github_com_containerd_ttrpc_request_proto_rawDescData = file_github_com_containerd_ttrpc_request_proto_rawDesc + file_request_proto_rawDescOnce sync.Once + file_request_proto_rawDescData = file_request_proto_rawDesc ) -func file_github_com_containerd_ttrpc_request_proto_rawDescGZIP() []byte { - file_github_com_containerd_ttrpc_request_proto_rawDescOnce.Do(func() { - file_github_com_containerd_ttrpc_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_ttrpc_request_proto_rawDescData) +func file_request_proto_rawDescGZIP() []byte { + file_request_proto_rawDescOnce.Do(func() { + file_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_request_proto_rawDescData) }) - return file_github_com_containerd_ttrpc_request_proto_rawDescData + return file_request_proto_rawDescData } -var file_github_com_containerd_ttrpc_request_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_github_com_containerd_ttrpc_request_proto_goTypes = []interface{}{ +var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_request_proto_goTypes = []interface{}{ (*Request)(nil), // 0: ttrpc.Request (*Response)(nil), // 1: ttrpc.Response (*StringList)(nil), // 2: ttrpc.StringList (*KeyValue)(nil), // 3: ttrpc.KeyValue - (*status.Status)(nil), // 4: Status + (*status.Status)(nil), // 4: google.rpc.Status } -var file_github_com_containerd_ttrpc_request_proto_depIdxs = []int32{ +var file_request_proto_depIdxs = []int32{ 3, // 0: ttrpc.Request.metadata:type_name -> ttrpc.KeyValue - 4, // 1: ttrpc.Response.status:type_name -> Status + 4, // 1: ttrpc.Response.status:type_name -> google.rpc.Status 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -320,13 +319,13 @@ var file_github_com_containerd_ttrpc_request_proto_depIdxs = []int32{ 0, // [0:2] is the sub-list for field type_name } -func init() { file_github_com_containerd_ttrpc_request_proto_init() } -func file_github_com_containerd_ttrpc_request_proto_init() { - if File_github_com_containerd_ttrpc_request_proto != nil { +func init() { file_request_proto_init() } +func file_request_proto_init() { + if File_request_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_github_com_containerd_ttrpc_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Request); i { case 0: return &v.state @@ -338,7 +337,7 @@ func file_github_com_containerd_ttrpc_request_proto_init() { return nil } } - file_github_com_containerd_ttrpc_request_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_request_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Response); i { case 0: return &v.state @@ -350,7 +349,7 @@ func file_github_com_containerd_ttrpc_request_proto_init() { return nil } } - file_github_com_containerd_ttrpc_request_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_request_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StringList); i { case 0: return &v.state @@ -362,7 +361,7 @@ func file_github_com_containerd_ttrpc_request_proto_init() { return nil } } - file_github_com_containerd_ttrpc_request_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_request_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KeyValue); i { case 0: return &v.state @@ -379,18 +378,18 @@ func file_github_com_containerd_ttrpc_request_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_ttrpc_request_proto_rawDesc, + RawDescriptor: file_request_proto_rawDesc, NumEnums: 0, NumMessages: 4, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_github_com_containerd_ttrpc_request_proto_goTypes, - DependencyIndexes: file_github_com_containerd_ttrpc_request_proto_depIdxs, - MessageInfos: file_github_com_containerd_ttrpc_request_proto_msgTypes, + GoTypes: file_request_proto_goTypes, + DependencyIndexes: file_request_proto_depIdxs, + MessageInfos: file_request_proto_msgTypes, }.Build() - File_github_com_containerd_ttrpc_request_proto = out.File - file_github_com_containerd_ttrpc_request_proto_rawDesc = nil - file_github_com_containerd_ttrpc_request_proto_goTypes = nil - file_github_com_containerd_ttrpc_request_proto_depIdxs = nil + File_request_proto = out.File + file_request_proto_rawDesc = nil + file_request_proto_goTypes = nil + file_request_proto_depIdxs = nil } diff --git a/request.proto b/request.proto index 37da334fc..3602eed1e 100644 --- a/request.proto +++ b/request.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ttrpc; -import "proto/status.proto"; +import "google/rpc/status.proto"; option go_package = "github.com/containerd/ttrpc"; @@ -15,7 +15,7 @@ message Request { } message Response { - Status status = 1; + google.rpc.Status status = 1; bytes payload = 2; } From 056f6193c49266cd49c71628cfe3a7380c877a93 Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Sun, 22 Mar 2026 21:29:45 -0700 Subject: [PATCH 2/2] Update CI workflow to use buf instead of protobuild Replace the protobuild job with buf to match the Makefile migration in the previous commit. Uses bufbuild/buf-action@v1 for buf setup. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Kazuyoshi Kato --- .github/workflows/ci.yml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d248f426..9c9ded5dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,10 +99,10 @@ jobs: make integration # - # Run Protobuild + # Run Buf # - protobuild: - name: Run Protobuild + buf: + name: Run Buf runs-on: ubuntu-22.04 timeout-minutes: 5 steps: @@ -116,24 +116,17 @@ jobs: go-version: 'stable' id: go - - name: Setup Go binary path - shell: bash - run: | - echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV - echo "${{ github.workspace }}/bin" >> $GITHUB_PATH - - - name: Install dependencies - working-directory: src/github.com/containerd/ttrpc - run: | - sudo make install-protobuf - make install-protobuild + - name: Install buf + uses: bufbuild/buf-action@v1 + with: + setup_only: true - name: Install protoc-gen-go-ttrpc working-directory: src/github.com/containerd/ttrpc run: | make install - - name: Run Protobuild + - name: Check protos working-directory: src/github.com/containerd/ttrpc run: | make check-protos