From a9d6db0417eb8582ce9a482219d6a7e62efb25be Mon Sep 17 00:00:00 2001 From: kevburnsjr Date: Sat, 4 Jan 2025 10:17:59 -0800 Subject: [PATCH] proto upgrade --- go.mod | 5 +- go.sum | 10 +- internal/doc.go | 1 + internal/zongzi.pb.go | 490 ++++++++++++++++++++++++++++++------- internal/zongzi_grpc.pb.go | 106 ++++---- 5 files changed, 462 insertions(+), 150 deletions(-) create mode 100644 internal/doc.go diff --git a/go.mod b/go.mod index 787d008..d871ece 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/lni/dragonboat/v4 v4.0.0-20231222133740-1d6e2d76cd57 github.com/stretchr/testify v1.9.0 google.golang.org/grpc v1.67.1 - google.golang.org/protobuf v1.34.2 + google.golang.org/protobuf v1.36.0 ) require ( @@ -54,7 +54,8 @@ require ( golang.org/x/net v0.33.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/genproto v0.0.0-20241219192143-6b3ec007d9bb // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 7b05cd9..5589329 100644 --- a/go.sum +++ b/go.sum @@ -469,8 +469,10 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto v0.0.0-20241219192143-6b3ec007d9bb h1:JGs+s1Q6osip3cDY197L1HmkuPn8wPp9Hfy9jl+Uz+U= +google.golang.org/genproto v0.0.0-20241219192143-6b3ec007d9bb/go.mod h1:o8GgNarfULyZPNaIY8RDfXM7AZcmcKC/tbMWp/ZOFDw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb h1:3oy2tynMOP1QbTC0MsNNAV+Se8M2Bd0A5+x1QHyw+pI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -491,8 +493,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ= +google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/doc.go b/internal/doc.go new file mode 100644 index 0000000..5bf0569 --- /dev/null +++ b/internal/doc.go @@ -0,0 +1 @@ +package internal diff --git a/internal/zongzi.pb.go b/internal/zongzi.pb.go index 250d954..7c7f636 100644 --- a/internal/zongzi.pb.go +++ b/internal/zongzi.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.33.0 // protoc v3.12.4 // source: zongzi.proto @@ -28,9 +28,11 @@ type PingRequest struct { func (x *PingRequest) Reset() { *x = PingRequest{} - mi := &file_zongzi_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *PingRequest) String() string { @@ -41,7 +43,7 @@ func (*PingRequest) ProtoMessage() {} func (x *PingRequest) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[0] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -64,9 +66,11 @@ type PingResponse struct { func (x *PingResponse) Reset() { *x = PingResponse{} - mi := &file_zongzi_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *PingResponse) String() string { @@ -77,7 +81,7 @@ func (*PingResponse) ProtoMessage() {} func (x *PingResponse) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[1] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -100,9 +104,11 @@ type ProbeRequest struct { func (x *ProbeRequest) Reset() { *x = ProbeRequest{} - mi := &file_zongzi_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ProbeRequest) String() string { @@ -113,7 +119,7 @@ func (*ProbeRequest) ProtoMessage() {} func (x *ProbeRequest) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[2] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -138,9 +144,11 @@ type ProbeResponse struct { func (x *ProbeResponse) Reset() { *x = ProbeResponse{} - mi := &file_zongzi_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ProbeResponse) String() string { @@ -151,7 +159,7 @@ func (*ProbeResponse) ProtoMessage() {} func (x *ProbeResponse) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[3] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -181,9 +189,11 @@ type InfoRequest struct { func (x *InfoRequest) Reset() { *x = InfoRequest{} - mi := &file_zongzi_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *InfoRequest) String() string { @@ -194,7 +204,7 @@ func (*InfoRequest) ProtoMessage() {} func (x *InfoRequest) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[4] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -220,9 +230,11 @@ type InfoResponse struct { func (x *InfoResponse) Reset() { *x = InfoResponse{} - mi := &file_zongzi_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *InfoResponse) String() string { @@ -233,7 +245,7 @@ func (*InfoResponse) ProtoMessage() {} func (x *InfoResponse) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[5] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -270,9 +282,11 @@ type MembersRequest struct { func (x *MembersRequest) Reset() { *x = MembersRequest{} - mi := &file_zongzi_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *MembersRequest) String() string { @@ -283,7 +297,7 @@ func (*MembersRequest) ProtoMessage() {} func (x *MembersRequest) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[6] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -308,9 +322,11 @@ type MembersResponse struct { func (x *MembersResponse) Reset() { *x = MembersResponse{} - mi := &file_zongzi_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *MembersResponse) String() string { @@ -321,7 +337,7 @@ func (*MembersResponse) ProtoMessage() {} func (x *MembersResponse) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[7] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -354,9 +370,11 @@ type JoinRequest struct { func (x *JoinRequest) Reset() { *x = JoinRequest{} - mi := &file_zongzi_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *JoinRequest) String() string { @@ -367,7 +385,7 @@ func (*JoinRequest) ProtoMessage() {} func (x *JoinRequest) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[8] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -407,9 +425,11 @@ type JoinResponse struct { func (x *JoinResponse) Reset() { *x = JoinResponse{} - mi := &file_zongzi_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *JoinResponse) String() string { @@ -420,7 +440,7 @@ func (*JoinResponse) ProtoMessage() {} func (x *JoinResponse) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[9] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -462,9 +482,11 @@ type AddRequest struct { func (x *AddRequest) Reset() { *x = AddRequest{} - mi := &file_zongzi_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AddRequest) String() string { @@ -475,7 +497,7 @@ func (*AddRequest) ProtoMessage() {} func (x *AddRequest) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[10] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -529,9 +551,11 @@ type AddResponse struct { func (x *AddResponse) Reset() { *x = AddResponse{} - mi := &file_zongzi_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *AddResponse) String() string { @@ -542,7 +566,7 @@ func (*AddResponse) ProtoMessage() {} func (x *AddResponse) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[11] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -581,9 +605,11 @@ type IndexRequest struct { func (x *IndexRequest) Reset() { *x = IndexRequest{} - mi := &file_zongzi_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *IndexRequest) String() string { @@ -594,7 +620,7 @@ func (*IndexRequest) ProtoMessage() {} func (x *IndexRequest) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[12] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -624,9 +650,11 @@ type IndexResponse struct { func (x *IndexResponse) Reset() { *x = IndexResponse{} - mi := &file_zongzi_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *IndexResponse) String() string { @@ -637,7 +665,7 @@ func (*IndexResponse) ProtoMessage() {} func (x *IndexResponse) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[13] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -663,9 +691,11 @@ type ApplyRequest struct { func (x *ApplyRequest) Reset() { *x = ApplyRequest{} - mi := &file_zongzi_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ApplyRequest) String() string { @@ -676,7 +706,7 @@ func (*ApplyRequest) ProtoMessage() {} func (x *ApplyRequest) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[14] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -716,9 +746,11 @@ type ApplyResponse struct { func (x *ApplyResponse) Reset() { *x = ApplyResponse{} - mi := &file_zongzi_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ApplyResponse) String() string { @@ -729,7 +761,7 @@ func (*ApplyResponse) ProtoMessage() {} func (x *ApplyResponse) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[15] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -769,9 +801,11 @@ type CommitRequest struct { func (x *CommitRequest) Reset() { *x = CommitRequest{} - mi := &file_zongzi_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *CommitRequest) String() string { @@ -782,7 +816,7 @@ func (*CommitRequest) ProtoMessage() {} func (x *CommitRequest) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[16] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -819,9 +853,11 @@ type CommitResponse struct { func (x *CommitResponse) Reset() { *x = CommitResponse{} - mi := &file_zongzi_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *CommitResponse) String() string { @@ -832,7 +868,7 @@ func (*CommitResponse) ProtoMessage() {} func (x *CommitResponse) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[17] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -859,9 +895,11 @@ type ReadRequest struct { func (x *ReadRequest) Reset() { *x = ReadRequest{} - mi := &file_zongzi_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ReadRequest) String() string { @@ -872,7 +910,7 @@ func (*ReadRequest) ProtoMessage() {} func (x *ReadRequest) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[18] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -919,9 +957,11 @@ type ReadResponse struct { func (x *ReadResponse) Reset() { *x = ReadResponse{} - mi := &file_zongzi_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *ReadResponse) String() string { @@ -932,7 +972,7 @@ func (*ReadResponse) ProtoMessage() {} func (x *ReadResponse) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[19] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -973,9 +1013,11 @@ type WatchRequest struct { func (x *WatchRequest) Reset() { *x = WatchRequest{} - mi := &file_zongzi_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *WatchRequest) String() string { @@ -986,7 +1028,7 @@ func (*WatchRequest) ProtoMessage() {} func (x *WatchRequest) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[20] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1033,9 +1075,11 @@ type WatchResponse struct { func (x *WatchResponse) Reset() { *x = WatchResponse{} - mi := &file_zongzi_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if protoimpl.UnsafeEnabled { + mi := &file_zongzi_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } func (x *WatchResponse) String() string { @@ -1046,7 +1090,7 @@ func (*WatchResponse) ProtoMessage() {} func (x *WatchResponse) ProtoReflect() protoreflect.Message { mi := &file_zongzi_proto_msgTypes[21] - if x != nil { + if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1215,7 +1259,7 @@ func file_zongzi_proto_rawDescGZIP() []byte { } var file_zongzi_proto_msgTypes = make([]protoimpl.MessageInfo, 23) -var file_zongzi_proto_goTypes = []any{ +var file_zongzi_proto_goTypes = []interface{}{ (*PingRequest)(nil), // 0: zongzi.PingRequest (*PingResponse)(nil), // 1: zongzi.PingResponse (*ProbeRequest)(nil), // 2: zongzi.ProbeRequest @@ -1276,6 +1320,272 @@ func file_zongzi_proto_init() { if File_zongzi_proto != nil { return } + if !protoimpl.UnsafeEnabled { + file_zongzi_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PingRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProbeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProbeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MembersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MembersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JoinRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JoinResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IndexRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IndexResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommitRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommitResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WatchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_zongzi_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WatchResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/internal/zongzi_grpc.pb.go b/internal/zongzi_grpc.pb.go index b754684..5682138 100644 --- a/internal/zongzi_grpc.pb.go +++ b/internal/zongzi_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.12.4 // source: zongzi.proto @@ -15,8 +15,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 const ( Internal_Ping_FullMethodName = "/zongzi.Internal/Ping" @@ -35,8 +35,6 @@ const ( // InternalClient is the client API for Internal service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Zongzi uses an internal gRPC service for cluster coordination type InternalClient interface { // Ping is a noop for timing purposes Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) @@ -64,7 +62,7 @@ type InternalClient interface { // Read provides unary request/response query forwarding Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) // Watch provides streaming query response forwarding - Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[WatchResponse], error) + Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Internal_WatchClient, error) } type internalClient struct { @@ -76,9 +74,8 @@ func NewInternalClient(cc grpc.ClientConnInterface) InternalClient { } func (c *internalClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(PingResponse) - err := c.cc.Invoke(ctx, Internal_Ping_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Internal_Ping_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -86,9 +83,8 @@ func (c *internalClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc } func (c *internalClient) Probe(ctx context.Context, in *ProbeRequest, opts ...grpc.CallOption) (*ProbeResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ProbeResponse) - err := c.cc.Invoke(ctx, Internal_Probe_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Internal_Probe_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -96,9 +92,8 @@ func (c *internalClient) Probe(ctx context.Context, in *ProbeRequest, opts ...gr } func (c *internalClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(InfoResponse) - err := c.cc.Invoke(ctx, Internal_Info_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Internal_Info_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -106,9 +101,8 @@ func (c *internalClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc } func (c *internalClient) Members(ctx context.Context, in *MembersRequest, opts ...grpc.CallOption) (*MembersResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MembersResponse) - err := c.cc.Invoke(ctx, Internal_Members_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Internal_Members_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -116,9 +110,8 @@ func (c *internalClient) Members(ctx context.Context, in *MembersRequest, opts . } func (c *internalClient) Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*JoinResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(JoinResponse) - err := c.cc.Invoke(ctx, Internal_Join_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Internal_Join_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -126,9 +119,8 @@ func (c *internalClient) Join(ctx context.Context, in *JoinRequest, opts ...grpc } func (c *internalClient) Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(AddResponse) - err := c.cc.Invoke(ctx, Internal_Add_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Internal_Add_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -136,9 +128,8 @@ func (c *internalClient) Add(ctx context.Context, in *AddRequest, opts ...grpc.C } func (c *internalClient) Index(ctx context.Context, in *IndexRequest, opts ...grpc.CallOption) (*IndexResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(IndexResponse) - err := c.cc.Invoke(ctx, Internal_Index_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Internal_Index_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -146,9 +137,8 @@ func (c *internalClient) Index(ctx context.Context, in *IndexRequest, opts ...gr } func (c *internalClient) Apply(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ApplyResponse) - err := c.cc.Invoke(ctx, Internal_Apply_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Internal_Apply_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -156,9 +146,8 @@ func (c *internalClient) Apply(ctx context.Context, in *ApplyRequest, opts ...gr } func (c *internalClient) Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CommitResponse) - err := c.cc.Invoke(ctx, Internal_Commit_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Internal_Commit_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -166,22 +155,20 @@ func (c *internalClient) Commit(ctx context.Context, in *CommitRequest, opts ... } func (c *internalClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ReadResponse) - err := c.cc.Invoke(ctx, Internal_Read_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Internal_Read_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *internalClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[WatchResponse], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &Internal_ServiceDesc.Streams[0], Internal_Watch_FullMethodName, cOpts...) +func (c *internalClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Internal_WatchClient, error) { + stream, err := c.cc.NewStream(ctx, &Internal_ServiceDesc.Streams[0], Internal_Watch_FullMethodName, opts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[WatchRequest, WatchResponse]{ClientStream: stream} + x := &internalWatchClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -191,14 +178,26 @@ func (c *internalClient) Watch(ctx context.Context, in *WatchRequest, opts ...gr return x, nil } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Internal_WatchClient = grpc.ServerStreamingClient[WatchResponse] +type Internal_WatchClient interface { + Recv() (*WatchResponse, error) + grpc.ClientStream +} + +type internalWatchClient struct { + grpc.ClientStream +} + +func (x *internalWatchClient) Recv() (*WatchResponse, error) { + m := new(WatchResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} // InternalServer is the server API for Internal service. // All implementations must embed UnimplementedInternalServer -// for forward compatibility. -// -// Zongzi uses an internal gRPC service for cluster coordination +// for forward compatibility type InternalServer interface { // Ping is a noop for timing purposes Ping(context.Context, *PingRequest) (*PingResponse, error) @@ -226,16 +225,13 @@ type InternalServer interface { // Read provides unary request/response query forwarding Read(context.Context, *ReadRequest) (*ReadResponse, error) // Watch provides streaming query response forwarding - Watch(*WatchRequest, grpc.ServerStreamingServer[WatchResponse]) error + Watch(*WatchRequest, Internal_WatchServer) error mustEmbedUnimplementedInternalServer() } -// UnimplementedInternalServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedInternalServer struct{} +// UnimplementedInternalServer must be embedded to have forward compatible implementations. +type UnimplementedInternalServer struct { +} func (UnimplementedInternalServer) Ping(context.Context, *PingRequest) (*PingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") @@ -267,11 +263,10 @@ func (UnimplementedInternalServer) Commit(context.Context, *CommitRequest) (*Com func (UnimplementedInternalServer) Read(context.Context, *ReadRequest) (*ReadResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Read not implemented") } -func (UnimplementedInternalServer) Watch(*WatchRequest, grpc.ServerStreamingServer[WatchResponse]) error { +func (UnimplementedInternalServer) Watch(*WatchRequest, Internal_WatchServer) error { return status.Errorf(codes.Unimplemented, "method Watch not implemented") } func (UnimplementedInternalServer) mustEmbedUnimplementedInternalServer() {} -func (UnimplementedInternalServer) testEmbeddedByValue() {} // UnsafeInternalServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to InternalServer will @@ -281,13 +276,6 @@ type UnsafeInternalServer interface { } func RegisterInternalServer(s grpc.ServiceRegistrar, srv InternalServer) { - // If the following call pancis, it indicates UnimplementedInternalServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(&Internal_ServiceDesc, srv) } @@ -476,11 +464,21 @@ func _Internal_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { if err := stream.RecvMsg(m); err != nil { return err } - return srv.(InternalServer).Watch(m, &grpc.GenericServerStream[WatchRequest, WatchResponse]{ServerStream: stream}) + return srv.(InternalServer).Watch(m, &internalWatchServer{stream}) +} + +type Internal_WatchServer interface { + Send(*WatchResponse) error + grpc.ServerStream +} + +type internalWatchServer struct { + grpc.ServerStream } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Internal_WatchServer = grpc.ServerStreamingServer[WatchResponse] +func (x *internalWatchServer) Send(m *WatchResponse) error { + return x.ServerStream.SendMsg(m) +} // Internal_ServiceDesc is the grpc.ServiceDesc for Internal service. // It's only intended for direct use with grpc.RegisterService,