From 048ce0e4b8407a69c5b563bee081eafeb8dccec1 Mon Sep 17 00:00:00 2001 From: Fadhli Dzil Ikram Date: Mon, 26 Jun 2023 20:22:51 +0700 Subject: [PATCH] chore: upgrade proto package --- README.md | 4 +- cmd/server/main.go | 2 +- example_pb_test.go | 197 ++++++++--- example_test.go | 2 +- go.mod | 5 +- go.sum | 3 - groupcache.go | 6 +- groupcache_test.go | 12 +- groupcachepb/example.proto | 4 +- groupcachepb/groupcache.pb.go | 387 +++++++++++++++----- groupcachepb/groupcache.proto | 2 + http.go | 6 +- peers.go | 2 +- proto.sh | 9 +- sinks.go | 2 +- testpb/test.pb.go | 649 +++++++++++++++++++++++++++------- testpb/test.proto | 2 + 17 files changed, 989 insertions(+), 305 deletions(-) diff --git a/README.md b/README.md index 2e82a16..2ece973 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ modifications. groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases. -For API docs and examples, see http://godoc.org/github.com/mailgun/groupcache/v2 +For API docs and examples, see http://godoc.org/github.com/adzil/groupcache/v2 ### Modifications from original library @@ -87,7 +87,7 @@ import ( "log" "time" - "github.com/mailgun/groupcache/v2" + "github.com/adzil/groupcache/v2" ) func ExampleUsage() { diff --git a/cmd/server/main.go b/cmd/server/main.go index bbaf26c..c470d16 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -12,7 +12,7 @@ import ( "syscall" "time" - "github.com/mailgun/groupcache/v2" + "github.com/adzil/groupcache/v2" ) var store = map[string]string{} diff --git a/example_pb_test.go b/example_pb_test.go index 621b82f..cb2a2d0 100644 --- a/example_pb_test.go +++ b/example_pb_test.go @@ -1,88 +1,171 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v4.23.2 // source: example.proto -/* -Package groupcache_test is a generated protocol buffer package. +package groupcache_test -It is generated from these files: - example.proto +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -It has these top-level messages: - User -*/ -package groupcache_test +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Age int64 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"` + IsSuper bool `protobuf:"varint,4,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` +} -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_example_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -type User struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Age int64 `protobuf:"varint,3,opt,name=age" json:"age,omitempty"` - IsSuper bool `protobuf:"varint,4,opt,name=is_super,json=isSuper" json:"is_super,omitempty"` +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *User) Reset() { *m = User{} } -func (m *User) String() string { return proto.CompactTextString(m) } -func (*User) ProtoMessage() {} -func (*User) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*User) ProtoMessage() {} -func (m *User) GetId() string { - if m != nil { - return m.Id +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_example_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_example_proto_rawDescGZIP(), []int{0} +} + +func (x *User) GetId() string { + if x != nil { + return x.Id } return "" } -func (m *User) GetName() string { - if m != nil { - return m.Name +func (x *User) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *User) GetAge() int64 { - if m != nil { - return m.Age +func (x *User) GetAge() int64 { + if x != nil { + return x.Age } return 0 } -func (m *User) GetIsSuper() bool { - if m != nil { - return m.IsSuper +func (x *User) GetIsSuper() bool { + if x != nil { + return x.IsSuper } return false } -func init() { - proto.RegisterType((*User)(nil), "groupcachepb.User") +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, + 0x0c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x63, 0x61, 0x63, 0x68, 0x65, 0x70, 0x62, 0x22, 0x57, 0x0a, + 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x73, 0x5f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, + 0x73, 0x53, 0x75, 0x70, 0x65, 0x72, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x7a, 0x69, 0x6c, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x63, 0x61, 0x63, 0x68, 0x65, + 0x5f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_example_proto_rawDescOnce sync.Once + file_example_proto_rawDescData = file_example_proto_rawDesc +) + +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_example_proto_rawDescData +} + +var file_example_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_example_proto_goTypes = []interface{}{ + (*User)(nil), // 0: groupcachepb.User +} +var file_example_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 + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } -func init() { proto.RegisterFile("example.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 148 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4d, 0xad, 0x48, 0xcc, - 0x2d, 0xc8, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x49, 0x2f, 0xca, 0x2f, 0x2d, - 0x48, 0x4e, 0x4c, 0xce, 0x48, 0x2d, 0x48, 0x52, 0x0a, 0xe7, 0x62, 0x09, 0x2d, 0x4e, 0x2d, 0x12, - 0xe2, 0xe3, 0x62, 0xca, 0x4c, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x62, 0xca, 0x4c, 0x11, - 0x12, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d, 0x95, 0x60, 0x02, 0x8b, 0x80, 0xd9, 0x42, 0x02, 0x5c, - 0xcc, 0x89, 0xe9, 0xa9, 0x12, 0xcc, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x20, 0xa6, 0x90, 0x24, 0x17, - 0x47, 0x66, 0x71, 0x7c, 0x71, 0x69, 0x41, 0x6a, 0x91, 0x04, 0x8b, 0x02, 0xa3, 0x06, 0x47, 0x10, - 0x7b, 0x66, 0x71, 0x30, 0x88, 0xeb, 0x24, 0x18, 0xc5, 0x8f, 0xb0, 0x28, 0xbe, 0x24, 0xb5, 0xb8, - 0x24, 0x89, 0x0d, 0xec, 0x00, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, 0x2e, 0x5f, 0x1a, - 0x91, 0x00, 0x00, 0x00, +func init() { file_example_proto_init() } +func file_example_proto_init() { + if File_example_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_example_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); 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{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_example_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_example_proto_goTypes, + DependencyIndexes: file_example_proto_depIdxs, + MessageInfos: file_example_proto_msgTypes, + }.Build() + File_example_proto = out.File + file_example_proto_rawDesc = nil + file_example_proto_goTypes = nil + file_example_proto_depIdxs = nil } diff --git a/example_test.go b/example_test.go index 9fd306e..de29cd8 100644 --- a/example_test.go +++ b/example_test.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/mailgun/groupcache/v2" + "github.com/adzil/groupcache/v2" ) func ExampleUsage() { diff --git a/go.mod b/go.mod index 72812e3..c624b19 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,12 @@ -module github.com/mailgun/groupcache/v2 +module github.com/adzil/groupcache/v2 go 1.19 require ( - github.com/golang/protobuf v1.5.2 github.com/segmentio/fasthash v1.0.3 github.com/sirupsen/logrus v1.9.0 github.com/stretchr/testify v1.8.1 + google.golang.org/protobuf v1.28.1 ) require ( @@ -14,6 +14,5 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect - google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index e1d0665..9644623 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -27,7 +25,6 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= 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.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/groupcache.go b/groupcache.go index 541e89a..0e7616e 100644 --- a/groupcache.go +++ b/groupcache.go @@ -32,9 +32,9 @@ import ( "sync/atomic" "time" - pb "github.com/mailgun/groupcache/v2/groupcachepb" - "github.com/mailgun/groupcache/v2/lru" - "github.com/mailgun/groupcache/v2/singleflight" + pb "github.com/adzil/groupcache/v2/groupcachepb" + "github.com/adzil/groupcache/v2/lru" + "github.com/adzil/groupcache/v2/singleflight" "github.com/sirupsen/logrus" ) diff --git a/groupcache_test.go b/groupcache_test.go index 4a667ed..68fd702 100644 --- a/groupcache_test.go +++ b/groupcache_test.go @@ -23,16 +23,16 @@ import ( "errors" "fmt" "hash/crc32" - "reflect" "sync" "testing" "time" "unsafe" - "github.com/golang/protobuf/proto" - pb "github.com/mailgun/groupcache/v2/groupcachepb" - "github.com/mailgun/groupcache/v2/testpb" + pb "github.com/adzil/groupcache/v2/groupcachepb" + "github.com/adzil/groupcache/v2/testpb" "github.com/stretchr/testify/assert" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" ) var ( @@ -161,8 +161,8 @@ func TestGetDupSuppressProto(t *testing.T) { for i := 0; i < 2; i++ { select { case v := <-resc: - if !reflect.DeepEqual(v, want) { - t.Errorf(" Got: %v\nWant: %v", proto.CompactTextString(v), proto.CompactTextString(want)) + if !proto.Equal(v, want) { + t.Errorf(" Got: %v\nWant: %v", prototext.Format(v), prototext.Format(want)) } case <-time.After(5 * time.Second): t.Errorf("timeout waiting on getter #%d of 2", i+1) diff --git a/groupcachepb/example.proto b/groupcachepb/example.proto index 92dd7d0..e46cd43 100644 --- a/groupcachepb/example.proto +++ b/groupcachepb/example.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -option go_package = "groupcache_test"; +option go_package = "github.com/adzil/groupcache/groupcache_test"; package groupcachepb; @@ -9,4 +9,4 @@ message User { string name = 2; int64 age = 3; bool is_super = 4; -} \ No newline at end of file +} diff --git a/groupcachepb/groupcache.pb.go b/groupcachepb/groupcache.pb.go index d6abd47..c7edb58 100644 --- a/groupcachepb/groupcache.pb.go +++ b/groupcachepb/groupcache.pb.go @@ -1,155 +1,346 @@ +// +//Copyright 2012 Google Inc. +// +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v4.23.2 // source: groupcache.proto -/* -Package groupcachepb is a generated protocol buffer package. +package groupcache -It is generated from these files: - groupcache.proto +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -It has these top-level messages: - GetRequest - GetResponse - SetRequest -*/ -package groupcachepb +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +type GetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf + Group *string `protobuf:"bytes,1,req,name=group" json:"group,omitempty"` + Key *string `protobuf:"bytes,2,req,name=key" json:"key,omitempty"` // not actually required/guaranteed to be UTF-8 +} -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +func (x *GetRequest) Reset() { + *x = GetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_groupcache_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -type GetRequest struct { - Group *string `protobuf:"bytes,1,req,name=group" json:"group,omitempty"` - Key *string `protobuf:"bytes,2,req,name=key" json:"key,omitempty"` - XXX_unrecognized []byte `json:"-"` +func (x *GetRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetRequest) Reset() { *m = GetRequest{} } -func (m *GetRequest) String() string { return proto.CompactTextString(m) } -func (*GetRequest) ProtoMessage() {} -func (*GetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*GetRequest) ProtoMessage() {} + +func (x *GetRequest) ProtoReflect() protoreflect.Message { + mi := &file_groupcache_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. +func (*GetRequest) Descriptor() ([]byte, []int) { + return file_groupcache_proto_rawDescGZIP(), []int{0} +} -func (m *GetRequest) GetGroup() string { - if m != nil && m.Group != nil { - return *m.Group +func (x *GetRequest) GetGroup() string { + if x != nil && x.Group != nil { + return *x.Group } return "" } -func (m *GetRequest) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key +func (x *GetRequest) GetKey() string { + if x != nil && x.Key != nil { + return *x.Key } return "" } type GetResponse struct { - Value []byte `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` - MinuteQps *float64 `protobuf:"fixed64,2,opt,name=minute_qps,json=minuteQps" json:"minute_qps,omitempty"` - Expire *int64 `protobuf:"varint,3,opt,name=expire" json:"expire,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value []byte `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + MinuteQps *float64 `protobuf:"fixed64,2,opt,name=minute_qps,json=minuteQps" json:"minute_qps,omitempty"` + Expire *int64 `protobuf:"varint,3,opt,name=expire" json:"expire,omitempty"` +} + +func (x *GetResponse) Reset() { + *x = GetResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_groupcache_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetResponse) Reset() { *m = GetResponse{} } -func (m *GetResponse) String() string { return proto.CompactTextString(m) } -func (*GetResponse) ProtoMessage() {} -func (*GetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (*GetResponse) ProtoMessage() {} + +func (x *GetResponse) ProtoReflect() protoreflect.Message { + mi := &file_groupcache_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. +func (*GetResponse) Descriptor() ([]byte, []int) { + return file_groupcache_proto_rawDescGZIP(), []int{1} +} -func (m *GetResponse) GetValue() []byte { - if m != nil { - return m.Value +func (x *GetResponse) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *GetResponse) GetMinuteQps() float64 { - if m != nil && m.MinuteQps != nil { - return *m.MinuteQps +func (x *GetResponse) GetMinuteQps() float64 { + if x != nil && x.MinuteQps != nil { + return *x.MinuteQps } return 0 } -func (m *GetResponse) GetExpire() int64 { - if m != nil && m.Expire != nil { - return *m.Expire +func (x *GetResponse) GetExpire() int64 { + if x != nil && x.Expire != nil { + return *x.Expire } return 0 } type SetRequest struct { - Group *string `protobuf:"bytes,1,req,name=group" json:"group,omitempty"` - Key *string `protobuf:"bytes,2,req,name=key" json:"key,omitempty"` - Value []byte `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` - Expire *int64 `protobuf:"varint,4,opt,name=expire" json:"expire,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Group *string `protobuf:"bytes,1,req,name=group" json:"group,omitempty"` + Key *string `protobuf:"bytes,2,req,name=key" json:"key,omitempty"` + Value []byte `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` + Expire *int64 `protobuf:"varint,4,opt,name=expire" json:"expire,omitempty"` +} + +func (x *SetRequest) Reset() { + *x = SetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_groupcache_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SetRequest) Reset() { *m = SetRequest{} } -func (m *SetRequest) String() string { return proto.CompactTextString(m) } -func (*SetRequest) ProtoMessage() {} -func (*SetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (*SetRequest) ProtoMessage() {} + +func (x *SetRequest) ProtoReflect() protoreflect.Message { + mi := &file_groupcache_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetRequest.ProtoReflect.Descriptor instead. +func (*SetRequest) Descriptor() ([]byte, []int) { + return file_groupcache_proto_rawDescGZIP(), []int{2} +} -func (m *SetRequest) GetGroup() string { - if m != nil && m.Group != nil { - return *m.Group +func (x *SetRequest) GetGroup() string { + if x != nil && x.Group != nil { + return *x.Group } return "" } -func (m *SetRequest) GetKey() string { - if m != nil && m.Key != nil { - return *m.Key +func (x *SetRequest) GetKey() string { + if x != nil && x.Key != nil { + return *x.Key } return "" } -func (m *SetRequest) GetValue() []byte { - if m != nil { - return m.Value +func (x *SetRequest) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *SetRequest) GetExpire() int64 { - if m != nil && m.Expire != nil { - return *m.Expire +func (x *SetRequest) GetExpire() int64 { + if x != nil && x.Expire != nil { + return *x.Expire } return 0 } -func init() { - proto.RegisterType((*GetRequest)(nil), "groupcachepb.GetRequest") - proto.RegisterType((*GetResponse)(nil), "groupcachepb.GetResponse") - proto.RegisterType((*SetRequest)(nil), "groupcachepb.SetRequest") -} - -func init() { proto.RegisterFile("groupcache.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 215 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x50, 0x31, 0x4b, 0xc5, 0x30, - 0x18, 0x34, 0x8d, 0x0a, 0xfd, 0xec, 0x50, 0x82, 0x48, 0x14, 0x84, 0x90, 0x29, 0x53, 0x07, 0x71, - 0x74, 0x73, 0x28, 0xb8, 0x19, 0x37, 0x17, 0x69, 0xcb, 0x87, 0x16, 0xb5, 0x49, 0x9b, 0x44, 0x7c, - 0xff, 0xfe, 0x91, 0xe6, 0x41, 0x3a, 0xbc, 0xe5, 0x6d, 0xb9, 0x3b, 0x2e, 0x77, 0xdf, 0x41, 0xfd, - 0xb9, 0x98, 0x60, 0x87, 0x6e, 0xf8, 0xc2, 0xc6, 0x2e, 0xc6, 0x1b, 0x56, 0x65, 0xc6, 0xf6, 0xf2, - 0x11, 0xa0, 0x45, 0xaf, 0x71, 0x0e, 0xe8, 0x3c, 0xbb, 0x86, 0x8b, 0x55, 0xe5, 0x44, 0x14, 0xaa, - 0xd4, 0x09, 0xb0, 0x1a, 0xe8, 0x37, 0xee, 0x78, 0xb1, 0x72, 0xf1, 0x29, 0xdf, 0xe1, 0x6a, 0x75, - 0x39, 0x6b, 0x26, 0x87, 0xd1, 0xf6, 0xd7, 0xfd, 0x04, 0xe4, 0x44, 0x10, 0x55, 0xe9, 0x04, 0xd8, - 0x3d, 0xc0, 0xef, 0x38, 0x05, 0x8f, 0x1f, 0xb3, 0x75, 0xbc, 0x10, 0x44, 0x11, 0x5d, 0x26, 0xe6, - 0xd5, 0x3a, 0x76, 0x03, 0x97, 0xf8, 0x6f, 0xc7, 0x05, 0x39, 0x15, 0x44, 0x51, 0x7d, 0x40, 0xb2, - 0x07, 0x78, 0x3b, 0xb9, 0x51, 0xae, 0x40, 0xb7, 0x15, 0x72, 0xc6, 0xf9, 0x36, 0xe3, 0xe1, 0x05, - 0xa0, 0x8d, 0x1f, 0x3d, 0xc7, 0x15, 0xd8, 0x13, 0xd0, 0x16, 0x3d, 0xe3, 0xcd, 0x76, 0x99, 0x26, - 0xcf, 0x72, 0x77, 0x7b, 0x44, 0x49, 0xa7, 0xcb, 0xb3, 0x7d, 0x00, 0x00, 0x00, 0xff, 0xff, 0x02, - 0x10, 0x64, 0xec, 0x62, 0x01, 0x00, 0x00, +var File_groupcache_proto protoreflect.FileDescriptor + +var file_groupcache_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x63, 0x61, 0x63, 0x68, 0x65, 0x70, 0x62, + 0x22, 0x34, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x05, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x02, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x5a, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, + 0x69, 0x6e, 0x75, 0x74, 0x65, 0x5f, 0x71, 0x70, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x09, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x51, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x22, 0x62, 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, + 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x02, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x32, 0x4a, 0x0a, 0x0a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, + 0x61, 0x63, 0x68, 0x65, 0x12, 0x3c, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x18, 0x2e, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x63, 0x61, 0x63, 0x68, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x63, 0x61, 0x63, + 0x68, 0x65, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x61, 0x64, 0x7a, 0x69, 0x6c, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x63, 0x61, 0x63, 0x68, + 0x65, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x63, 0x61, 0x63, 0x68, 0x65, +} + +var ( + file_groupcache_proto_rawDescOnce sync.Once + file_groupcache_proto_rawDescData = file_groupcache_proto_rawDesc +) + +func file_groupcache_proto_rawDescGZIP() []byte { + file_groupcache_proto_rawDescOnce.Do(func() { + file_groupcache_proto_rawDescData = protoimpl.X.CompressGZIP(file_groupcache_proto_rawDescData) + }) + return file_groupcache_proto_rawDescData +} + +var file_groupcache_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_groupcache_proto_goTypes = []interface{}{ + (*GetRequest)(nil), // 0: groupcachepb.GetRequest + (*GetResponse)(nil), // 1: groupcachepb.GetResponse + (*SetRequest)(nil), // 2: groupcachepb.SetRequest +} +var file_groupcache_proto_depIdxs = []int32{ + 0, // 0: groupcachepb.GroupCache.Get:input_type -> groupcachepb.GetRequest + 1, // 1: groupcachepb.GroupCache.Get:output_type -> groupcachepb.GetResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_groupcache_proto_init() } +func file_groupcache_proto_init() { + if File_groupcache_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_groupcache_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_groupcache_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_groupcache_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetRequest); 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{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_groupcache_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_groupcache_proto_goTypes, + DependencyIndexes: file_groupcache_proto_depIdxs, + MessageInfos: file_groupcache_proto_msgTypes, + }.Build() + File_groupcache_proto = out.File + file_groupcache_proto_rawDesc = nil + file_groupcache_proto_goTypes = nil + file_groupcache_proto_depIdxs = nil } diff --git a/groupcachepb/groupcache.proto b/groupcachepb/groupcache.proto index a24b410..a859092 100644 --- a/groupcachepb/groupcache.proto +++ b/groupcachepb/groupcache.proto @@ -16,6 +16,8 @@ limitations under the License. syntax = "proto2"; +option go_package = "github.com/adzil/groupcache/groupcache"; + package groupcachepb; message GetRequest { diff --git a/http.go b/http.go index 32e1f90..af1dd2d 100644 --- a/http.go +++ b/http.go @@ -29,9 +29,9 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" - "github.com/mailgun/groupcache/v2/consistenthash" - pb "github.com/mailgun/groupcache/v2/groupcachepb" + "github.com/adzil/groupcache/v2/consistenthash" + pb "github.com/adzil/groupcache/v2/groupcachepb" + "google.golang.org/protobuf/proto" ) const defaultBasePath = "/_groupcache/" diff --git a/peers.go b/peers.go index 39fd76a..862dd26 100644 --- a/peers.go +++ b/peers.go @@ -21,7 +21,7 @@ package groupcache import ( "context" - pb "github.com/mailgun/groupcache/v2/groupcachepb" + pb "github.com/adzil/groupcache/v2/groupcachepb" ) // ProtoGetter is the interface that must be implemented by a peer. diff --git a/proto.sh b/proto.sh index e710926..f5f8a2e 100755 --- a/proto.sh +++ b/proto.sh @@ -6,11 +6,16 @@ set -u set -x PROTO_DIR=groupcachepb +TESTPB_DIR=testpb protoc -I=$PROTO_DIR \ - --go_out=$PROTO_DIR \ + --go_out=paths=source_relative:$PROTO_DIR \ $PROTO_DIR/groupcache.proto protoc -I=$PROTO_DIR \ - --go_out=. \ + --go_out=paths=source_relative:. \ $PROTO_DIR/example.proto + +protoc -I=$TESTPB_DIR \ + --go_out=paths=source_relative:$TESTPB_DIR \ + $TESTPB_DIR/test.proto diff --git a/sinks.go b/sinks.go index cbfd1ff..7e1a751 100644 --- a/sinks.go +++ b/sinks.go @@ -20,7 +20,7 @@ import ( "errors" "time" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) var _ Sink = &stringSink{} diff --git a/testpb/test.pb.go b/testpb/test.pb.go index 038040d..da60bee 100644 --- a/testpb/test.pb.go +++ b/testpb/test.pb.go @@ -1,235 +1,640 @@ -// Code generated by protoc-gen-go. +// +//Copyright 2012 Google Inc. +// +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v4.23.2 // source: test.proto -// DO NOT EDIT! package testpb -import proto "github.com/golang/protobuf/proto" -import json "encoding/json" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference proto, json, and math imports to suppress error if they are not otherwise used. -var _ = proto.Marshal -var _ = &json.SyntaxError{} -var _ = math.Inf +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type TestMessage struct { - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - City *string `protobuf:"bytes,2,opt,name=city" json:"city,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + City *string `protobuf:"bytes,2,opt,name=city" json:"city,omitempty"` +} + +func (x *TestMessage) Reset() { + *x = TestMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_test_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TestMessage) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TestMessage) Reset() { *m = TestMessage{} } -func (m *TestMessage) String() string { return proto.CompactTextString(m) } -func (*TestMessage) ProtoMessage() {} +func (*TestMessage) ProtoMessage() {} -func (m *TestMessage) GetName() string { - if m != nil && m.Name != nil { - return *m.Name +func (x *TestMessage) ProtoReflect() protoreflect.Message { + mi := &file_test_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestMessage.ProtoReflect.Descriptor instead. +func (*TestMessage) Descriptor() ([]byte, []int) { + return file_test_proto_rawDescGZIP(), []int{0} +} + +func (x *TestMessage) GetName() string { + if x != nil && x.Name != nil { + return *x.Name } return "" } -func (m *TestMessage) GetCity() string { - if m != nil && m.City != nil { - return *m.City +func (x *TestMessage) GetCity() string { + if x != nil && x.City != nil { + return *x.City } return "" } type TestRequest struct { - Lower *string `protobuf:"bytes,1,req,name=lower" json:"lower,omitempty"` - RepeatCount *int32 `protobuf:"varint,2,opt,name=repeat_count,def=1" json:"repeat_count,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Lower *string `protobuf:"bytes,1,req,name=lower" json:"lower,omitempty"` // to be returned upper case + RepeatCount *int32 `protobuf:"varint,2,opt,name=repeat_count,json=repeatCount,def=1" json:"repeat_count,omitempty"` // .. this many times +} + +// Default values for TestRequest fields. +const ( + Default_TestRequest_RepeatCount = int32(1) +) + +func (x *TestRequest) Reset() { + *x = TestRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_test_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TestRequest) Reset() { *m = TestRequest{} } -func (m *TestRequest) String() string { return proto.CompactTextString(m) } -func (*TestRequest) ProtoMessage() {} +func (x *TestRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestRequest) ProtoMessage() {} + +func (x *TestRequest) ProtoReflect() protoreflect.Message { + mi := &file_test_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} -const Default_TestRequest_RepeatCount int32 = 1 +// Deprecated: Use TestRequest.ProtoReflect.Descriptor instead. +func (*TestRequest) Descriptor() ([]byte, []int) { + return file_test_proto_rawDescGZIP(), []int{1} +} -func (m *TestRequest) GetLower() string { - if m != nil && m.Lower != nil { - return *m.Lower +func (x *TestRequest) GetLower() string { + if x != nil && x.Lower != nil { + return *x.Lower } return "" } -func (m *TestRequest) GetRepeatCount() int32 { - if m != nil && m.RepeatCount != nil { - return *m.RepeatCount +func (x *TestRequest) GetRepeatCount() int32 { + if x != nil && x.RepeatCount != nil { + return *x.RepeatCount } return Default_TestRequest_RepeatCount } type TestResponse struct { - Value *string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value *string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` +} + +func (x *TestResponse) Reset() { + *x = TestResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_test_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TestResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TestResponse) Reset() { *m = TestResponse{} } -func (m *TestResponse) String() string { return proto.CompactTextString(m) } -func (*TestResponse) ProtoMessage() {} +func (*TestResponse) ProtoMessage() {} -func (m *TestResponse) GetValue() string { - if m != nil && m.Value != nil { - return *m.Value +func (x *TestResponse) ProtoReflect() protoreflect.Message { + mi := &file_test_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestResponse.ProtoReflect.Descriptor instead. +func (*TestResponse) Descriptor() ([]byte, []int) { + return file_test_proto_rawDescGZIP(), []int{2} +} + +func (x *TestResponse) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value } return "" } type CacheStats struct { - Items *int64 `protobuf:"varint,1,opt,name=items" json:"items,omitempty"` - Bytes *int64 `protobuf:"varint,2,opt,name=bytes" json:"bytes,omitempty"` - Gets *int64 `protobuf:"varint,3,opt,name=gets" json:"gets,omitempty"` - Hits *int64 `protobuf:"varint,4,opt,name=hits" json:"hits,omitempty"` - Evicts *int64 `protobuf:"varint,5,opt,name=evicts" json:"evicts,omitempty"` - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items *int64 `protobuf:"varint,1,opt,name=items" json:"items,omitempty"` + Bytes *int64 `protobuf:"varint,2,opt,name=bytes" json:"bytes,omitempty"` + Gets *int64 `protobuf:"varint,3,opt,name=gets" json:"gets,omitempty"` + Hits *int64 `protobuf:"varint,4,opt,name=hits" json:"hits,omitempty"` + Evicts *int64 `protobuf:"varint,5,opt,name=evicts" json:"evicts,omitempty"` } -func (m *CacheStats) Reset() { *m = CacheStats{} } -func (m *CacheStats) String() string { return proto.CompactTextString(m) } -func (*CacheStats) ProtoMessage() {} +func (x *CacheStats) Reset() { + *x = CacheStats{} + if protoimpl.UnsafeEnabled { + mi := &file_test_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -func (m *CacheStats) GetItems() int64 { - if m != nil && m.Items != nil { - return *m.Items +func (x *CacheStats) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CacheStats) ProtoMessage() {} + +func (x *CacheStats) ProtoReflect() protoreflect.Message { + mi := &file_test_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CacheStats.ProtoReflect.Descriptor instead. +func (*CacheStats) Descriptor() ([]byte, []int) { + return file_test_proto_rawDescGZIP(), []int{3} +} + +func (x *CacheStats) GetItems() int64 { + if x != nil && x.Items != nil { + return *x.Items } return 0 } -func (m *CacheStats) GetBytes() int64 { - if m != nil && m.Bytes != nil { - return *m.Bytes +func (x *CacheStats) GetBytes() int64 { + if x != nil && x.Bytes != nil { + return *x.Bytes } return 0 } -func (m *CacheStats) GetGets() int64 { - if m != nil && m.Gets != nil { - return *m.Gets +func (x *CacheStats) GetGets() int64 { + if x != nil && x.Gets != nil { + return *x.Gets } return 0 } -func (m *CacheStats) GetHits() int64 { - if m != nil && m.Hits != nil { - return *m.Hits +func (x *CacheStats) GetHits() int64 { + if x != nil && x.Hits != nil { + return *x.Hits } return 0 } -func (m *CacheStats) GetEvicts() int64 { - if m != nil && m.Evicts != nil { - return *m.Evicts +func (x *CacheStats) GetEvicts() int64 { + if x != nil && x.Evicts != nil { + return *x.Evicts } return 0 } type StatsResponse struct { - Gets *int64 `protobuf:"varint,1,opt,name=gets" json:"gets,omitempty"` - CacheHits *int64 `protobuf:"varint,12,opt,name=cache_hits" json:"cache_hits,omitempty"` - Fills *int64 `protobuf:"varint,2,opt,name=fills" json:"fills,omitempty"` - TotalAlloc *uint64 `protobuf:"varint,3,opt,name=total_alloc" json:"total_alloc,omitempty"` - MainCache *CacheStats `protobuf:"bytes,4,opt,name=main_cache" json:"main_cache,omitempty"` - HotCache *CacheStats `protobuf:"bytes,5,opt,name=hot_cache" json:"hot_cache,omitempty"` - ServerIn *int64 `protobuf:"varint,6,opt,name=server_in" json:"server_in,omitempty"` - Loads *int64 `protobuf:"varint,8,opt,name=loads" json:"loads,omitempty"` - PeerLoads *int64 `protobuf:"varint,9,opt,name=peer_loads" json:"peer_loads,omitempty"` - PeerErrors *int64 `protobuf:"varint,10,opt,name=peer_errors" json:"peer_errors,omitempty"` - LocalLoads *int64 `protobuf:"varint,11,opt,name=local_loads" json:"local_loads,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StatsResponse) Reset() { *m = StatsResponse{} } -func (m *StatsResponse) String() string { return proto.CompactTextString(m) } -func (*StatsResponse) ProtoMessage() {} - -func (m *StatsResponse) GetGets() int64 { - if m != nil && m.Gets != nil { - return *m.Gets + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Gets *int64 `protobuf:"varint,1,opt,name=gets" json:"gets,omitempty"` + CacheHits *int64 `protobuf:"varint,12,opt,name=cache_hits,json=cacheHits" json:"cache_hits,omitempty"` + Fills *int64 `protobuf:"varint,2,opt,name=fills" json:"fills,omitempty"` + TotalAlloc *uint64 `protobuf:"varint,3,opt,name=total_alloc,json=totalAlloc" json:"total_alloc,omitempty"` + MainCache *CacheStats `protobuf:"bytes,4,opt,name=main_cache,json=mainCache" json:"main_cache,omitempty"` + HotCache *CacheStats `protobuf:"bytes,5,opt,name=hot_cache,json=hotCache" json:"hot_cache,omitempty"` + ServerIn *int64 `protobuf:"varint,6,opt,name=server_in,json=serverIn" json:"server_in,omitempty"` + Loads *int64 `protobuf:"varint,8,opt,name=loads" json:"loads,omitempty"` + PeerLoads *int64 `protobuf:"varint,9,opt,name=peer_loads,json=peerLoads" json:"peer_loads,omitempty"` + PeerErrors *int64 `protobuf:"varint,10,opt,name=peer_errors,json=peerErrors" json:"peer_errors,omitempty"` + LocalLoads *int64 `protobuf:"varint,11,opt,name=local_loads,json=localLoads" json:"local_loads,omitempty"` +} + +func (x *StatsResponse) Reset() { + *x = StatsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_test_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatsResponse) ProtoMessage() {} + +func (x *StatsResponse) ProtoReflect() protoreflect.Message { + mi := &file_test_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatsResponse.ProtoReflect.Descriptor instead. +func (*StatsResponse) Descriptor() ([]byte, []int) { + return file_test_proto_rawDescGZIP(), []int{4} +} + +func (x *StatsResponse) GetGets() int64 { + if x != nil && x.Gets != nil { + return *x.Gets } return 0 } -func (m *StatsResponse) GetCacheHits() int64 { - if m != nil && m.CacheHits != nil { - return *m.CacheHits +func (x *StatsResponse) GetCacheHits() int64 { + if x != nil && x.CacheHits != nil { + return *x.CacheHits } return 0 } -func (m *StatsResponse) GetFills() int64 { - if m != nil && m.Fills != nil { - return *m.Fills +func (x *StatsResponse) GetFills() int64 { + if x != nil && x.Fills != nil { + return *x.Fills } return 0 } -func (m *StatsResponse) GetTotalAlloc() uint64 { - if m != nil && m.TotalAlloc != nil { - return *m.TotalAlloc +func (x *StatsResponse) GetTotalAlloc() uint64 { + if x != nil && x.TotalAlloc != nil { + return *x.TotalAlloc } return 0 } -func (m *StatsResponse) GetMainCache() *CacheStats { - if m != nil { - return m.MainCache +func (x *StatsResponse) GetMainCache() *CacheStats { + if x != nil { + return x.MainCache } return nil } -func (m *StatsResponse) GetHotCache() *CacheStats { - if m != nil { - return m.HotCache +func (x *StatsResponse) GetHotCache() *CacheStats { + if x != nil { + return x.HotCache } return nil } -func (m *StatsResponse) GetServerIn() int64 { - if m != nil && m.ServerIn != nil { - return *m.ServerIn +func (x *StatsResponse) GetServerIn() int64 { + if x != nil && x.ServerIn != nil { + return *x.ServerIn } return 0 } -func (m *StatsResponse) GetLoads() int64 { - if m != nil && m.Loads != nil { - return *m.Loads +func (x *StatsResponse) GetLoads() int64 { + if x != nil && x.Loads != nil { + return *x.Loads } return 0 } -func (m *StatsResponse) GetPeerLoads() int64 { - if m != nil && m.PeerLoads != nil { - return *m.PeerLoads +func (x *StatsResponse) GetPeerLoads() int64 { + if x != nil && x.PeerLoads != nil { + return *x.PeerLoads } return 0 } -func (m *StatsResponse) GetPeerErrors() int64 { - if m != nil && m.PeerErrors != nil { - return *m.PeerErrors +func (x *StatsResponse) GetPeerErrors() int64 { + if x != nil && x.PeerErrors != nil { + return *x.PeerErrors } return 0 } -func (m *StatsResponse) GetLocalLoads() int64 { - if m != nil && m.LocalLoads != nil { - return *m.LocalLoads +func (x *StatsResponse) GetLocalLoads() int64 { + if x != nil && x.LocalLoads != nil { + return *x.LocalLoads } return 0 } type Empty struct { - XXX_unrecognized []byte `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *Empty) Reset() { *m = Empty{} } -func (m *Empty) String() string { return proto.CompactTextString(m) } -func (*Empty) ProtoMessage() {} +func (x *Empty) Reset() { + *x = Empty{} + if protoimpl.UnsafeEnabled { + mi := &file_test_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -func init() { +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty) ProtoMessage() {} + +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_test_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_test_proto_rawDescGZIP(), []int{5} +} + +var File_test_proto protoreflect.FileDescriptor + +var file_test_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, + 0x73, 0x74, 0x70, 0x62, 0x22, 0x35, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x22, 0x49, 0x0a, 0x0b, 0x54, + 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x6f, + 0x77, 0x65, 0x72, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x6f, 0x77, 0x65, 0x72, + 0x12, 0x24, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x3a, 0x01, 0x31, 0x52, 0x0b, 0x72, 0x65, 0x70, 0x65, 0x61, + 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x24, 0x0a, 0x0c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x78, 0x0a, 0x0a, + 0x43, 0x61, 0x63, 0x68, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, + 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x65, 0x74, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x67, 0x65, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, + 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x68, 0x69, 0x74, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x65, 0x76, 0x69, 0x63, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x65, 0x76, 0x69, 0x63, 0x74, 0x73, 0x22, 0xf1, 0x02, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x65, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x67, 0x65, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x68, 0x69, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x63, 0x61, 0x63, 0x68, 0x65, 0x48, 0x69, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x66, + 0x69, 0x6c, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x6c, + 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x41, 0x6c, 0x6c, + 0x6f, 0x63, 0x12, 0x31, 0x0a, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x61, 0x63, 0x68, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, + 0x43, 0x61, 0x63, 0x68, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x09, 0x6d, 0x61, 0x69, 0x6e, + 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x68, 0x6f, 0x74, 0x5f, 0x63, 0x61, 0x63, + 0x68, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, + 0x62, 0x2e, 0x43, 0x61, 0x63, 0x68, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x08, 0x68, 0x6f, + 0x74, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x5f, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x49, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x65, 0x65, + 0x72, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, + 0x65, 0x65, 0x72, 0x4c, 0x6f, 0x61, 0x64, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x65, 0x65, 0x72, + 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, + 0x65, 0x65, 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4c, 0x6f, 0x61, 0x64, 0x73, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x32, 0xa5, 0x01, 0x0a, 0x0e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x61, 0x63, + 0x68, 0x65, 0x54, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x09, 0x49, 0x6e, 0x69, 0x74, 0x50, 0x65, + 0x65, 0x72, 0x73, 0x12, 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x13, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x14, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x73, 0x12, 0x0d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x24, 0x5a, 0x22, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x7a, 0x69, 0x6c, 0x2f, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, + 0x62, +} + +var ( + file_test_proto_rawDescOnce sync.Once + file_test_proto_rawDescData = file_test_proto_rawDesc +) + +func file_test_proto_rawDescGZIP() []byte { + file_test_proto_rawDescOnce.Do(func() { + file_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_proto_rawDescData) + }) + return file_test_proto_rawDescData +} + +var file_test_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_test_proto_goTypes = []interface{}{ + (*TestMessage)(nil), // 0: testpb.TestMessage + (*TestRequest)(nil), // 1: testpb.TestRequest + (*TestResponse)(nil), // 2: testpb.TestResponse + (*CacheStats)(nil), // 3: testpb.CacheStats + (*StatsResponse)(nil), // 4: testpb.StatsResponse + (*Empty)(nil), // 5: testpb.Empty +} +var file_test_proto_depIdxs = []int32{ + 3, // 0: testpb.StatsResponse.main_cache:type_name -> testpb.CacheStats + 3, // 1: testpb.StatsResponse.hot_cache:type_name -> testpb.CacheStats + 5, // 2: testpb.GroupCacheTest.InitPeers:input_type -> testpb.Empty + 1, // 3: testpb.GroupCacheTest.Get:input_type -> testpb.TestRequest + 5, // 4: testpb.GroupCacheTest.GetStats:input_type -> testpb.Empty + 5, // 5: testpb.GroupCacheTest.InitPeers:output_type -> testpb.Empty + 2, // 6: testpb.GroupCacheTest.Get:output_type -> testpb.TestResponse + 4, // 7: testpb.GroupCacheTest.GetStats:output_type -> testpb.StatsResponse + 5, // [5:8] is the sub-list for method output_type + 2, // [2:5] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_test_proto_init() } +func file_test_proto_init() { + if File_test_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TestMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TestRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TestResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CacheStats); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_test_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_test_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty); 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{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_test_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_test_proto_goTypes, + DependencyIndexes: file_test_proto_depIdxs, + MessageInfos: file_test_proto_msgTypes, + }.Build() + File_test_proto = out.File + file_test_proto_rawDesc = nil + file_test_proto_goTypes = nil + file_test_proto_depIdxs = nil } diff --git a/testpb/test.proto b/testpb/test.proto index b9dc6c9..5c079eb 100644 --- a/testpb/test.proto +++ b/testpb/test.proto @@ -16,6 +16,8 @@ limitations under the License. syntax = "proto2"; +option go_package = "github.com/adzil/groupcache/testpb"; + package testpb; message TestMessage {