From 18bd90828d472ea64b8d0ae78f7cd544dba69eef Mon Sep 17 00:00:00 2001 From: itzaname Date: Sat, 10 Sep 2022 15:56:32 -0400 Subject: [PATCH] Add datastore --- datastore/datastore.pb.go | 379 +++++++++++++++++++++++++++++++++ datastore/datastore_grpc.pb.go | 173 +++++++++++++++ 2 files changed, 552 insertions(+) create mode 100644 datastore/datastore.pb.go create mode 100644 datastore/datastore_grpc.pb.go diff --git a/datastore/datastore.pb.go b/datastore/datastore.pb.go new file mode 100644 index 0000000..7712074 --- /dev/null +++ b/datastore/datastore.pb.go @@ -0,0 +1,379 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v3.21.5 +// source: datastore.proto + +package datastore + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + structpb "google.golang.org/protobuf/types/known/structpb" + reflect "reflect" + sync "sync" +) + +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 KeyMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` +} + +func (x *KeyMessage) Reset() { + *x = KeyMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_datastore_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyMessage) ProtoMessage() {} + +func (x *KeyMessage) ProtoReflect() protoreflect.Message { + mi := &file_datastore_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 KeyMessage.ProtoReflect.Descriptor instead. +func (*KeyMessage) Descriptor() ([]byte, []int) { + return file_datastore_proto_rawDescGZIP(), []int{0} +} + +func (x *KeyMessage) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type UpdateMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` + Updates *structpb.Struct `protobuf:"bytes,2,opt,name=Updates,proto3" json:"Updates,omitempty"` + Deletes *structpb.Struct `protobuf:"bytes,3,opt,name=Deletes,proto3" json:"Deletes,omitempty"` +} + +func (x *UpdateMessage) Reset() { + *x = UpdateMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_datastore_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateMessage) ProtoMessage() {} + +func (x *UpdateMessage) ProtoReflect() protoreflect.Message { + mi := &file_datastore_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 UpdateMessage.ProtoReflect.Descriptor instead. +func (*UpdateMessage) Descriptor() ([]byte, []int) { + return file_datastore_proto_rawDescGZIP(), []int{1} +} + +func (x *UpdateMessage) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *UpdateMessage) GetUpdates() *structpb.Struct { + if x != nil { + return x.Updates + } + return nil +} + +func (x *UpdateMessage) GetDeletes() *structpb.Struct { + if x != nil { + return x.Deletes + } + return nil +} + +type ObjectResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` + Data *structpb.Struct `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"` +} + +func (x *ObjectResponse) Reset() { + *x = ObjectResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_datastore_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ObjectResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectResponse) ProtoMessage() {} + +func (x *ObjectResponse) ProtoReflect() protoreflect.Message { + mi := &file_datastore_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 ObjectResponse.ProtoReflect.Descriptor instead. +func (*ObjectResponse) Descriptor() ([]byte, []int) { + return file_datastore_proto_rawDescGZIP(), []int{2} +} + +func (x *ObjectResponse) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *ObjectResponse) GetData() *structpb.Struct { + if x != nil { + return x.Data + } + return nil +} + +type NullResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *NullResponse) Reset() { + *x = NullResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_datastore_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NullResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NullResponse) ProtoMessage() {} + +func (x *NullResponse) ProtoReflect() protoreflect.Message { + mi := &file_datastore_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 NullResponse.ProtoReflect.Descriptor instead. +func (*NullResponse) Descriptor() ([]byte, []int) { + return file_datastore_proto_rawDescGZIP(), []int{3} +} + +var File_datastore_proto protoreflect.FileDescriptor + +var file_datastore_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x09, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x1c, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1e, 0x0a, 0x0a, 0x4b, 0x65, + 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4b, 0x65, 0x79, 0x22, 0x87, 0x01, 0x0a, 0x0d, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x31, + 0x0a, 0x07, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x07, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x73, 0x12, 0x31, 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x07, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x0e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, + 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x0e, 0x0a, 0x0c, 0x4e, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xc4, 0x01, 0x0a, 0x10, 0x44, 0x61, 0x74, 0x61, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x03, 0x47, 0x65, + 0x74, 0x12, 0x15, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4b, 0x65, + 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x19, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x19, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x38, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x1a, 0x17, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x4e, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2c, 0x5a, 0x2a, + 0x67, 0x69, 0x74, 0x2e, 0x69, 0x74, 0x7a, 0x61, 0x6e, 0x61, 0x2e, 0x6d, 0x65, 0x2f, 0x73, 0x74, + 0x72, 0x61, 0x66, 0x65, 0x73, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_datastore_proto_rawDescOnce sync.Once + file_datastore_proto_rawDescData = file_datastore_proto_rawDesc +) + +func file_datastore_proto_rawDescGZIP() []byte { + file_datastore_proto_rawDescOnce.Do(func() { + file_datastore_proto_rawDescData = protoimpl.X.CompressGZIP(file_datastore_proto_rawDescData) + }) + return file_datastore_proto_rawDescData +} + +var file_datastore_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_datastore_proto_goTypes = []interface{}{ + (*KeyMessage)(nil), // 0: datastore.KeyMessage + (*UpdateMessage)(nil), // 1: datastore.UpdateMessage + (*ObjectResponse)(nil), // 2: datastore.ObjectResponse + (*NullResponse)(nil), // 3: datastore.NullResponse + (*structpb.Struct)(nil), // 4: google.protobuf.Struct +} +var file_datastore_proto_depIdxs = []int32{ + 4, // 0: datastore.UpdateMessage.Updates:type_name -> google.protobuf.Struct + 4, // 1: datastore.UpdateMessage.Deletes:type_name -> google.protobuf.Struct + 4, // 2: datastore.ObjectResponse.Data:type_name -> google.protobuf.Struct + 0, // 3: datastore.DatastoreService.Get:input_type -> datastore.KeyMessage + 1, // 4: datastore.DatastoreService.Update:input_type -> datastore.UpdateMessage + 0, // 5: datastore.DatastoreService.Delete:input_type -> datastore.KeyMessage + 2, // 6: datastore.DatastoreService.Get:output_type -> datastore.ObjectResponse + 2, // 7: datastore.DatastoreService.Update:output_type -> datastore.ObjectResponse + 3, // 8: datastore.DatastoreService.Delete:output_type -> datastore.NullResponse + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_datastore_proto_init() } +func file_datastore_proto_init() { + if File_datastore_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_datastore_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_datastore_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_datastore_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ObjectResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_datastore_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NullResponse); 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_datastore_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_datastore_proto_goTypes, + DependencyIndexes: file_datastore_proto_depIdxs, + MessageInfos: file_datastore_proto_msgTypes, + }.Build() + File_datastore_proto = out.File + file_datastore_proto_rawDesc = nil + file_datastore_proto_goTypes = nil + file_datastore_proto_depIdxs = nil +} diff --git a/datastore/datastore_grpc.pb.go b/datastore/datastore_grpc.pb.go new file mode 100644 index 0000000..631a70d --- /dev/null +++ b/datastore/datastore_grpc.pb.go @@ -0,0 +1,173 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package datastore + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// 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.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// DatastoreServiceClient is the client API for DatastoreService 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. +type DatastoreServiceClient interface { + Get(ctx context.Context, in *KeyMessage, opts ...grpc.CallOption) (*ObjectResponse, error) + Update(ctx context.Context, in *UpdateMessage, opts ...grpc.CallOption) (*ObjectResponse, error) + Delete(ctx context.Context, in *KeyMessage, opts ...grpc.CallOption) (*NullResponse, error) +} + +type datastoreServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewDatastoreServiceClient(cc grpc.ClientConnInterface) DatastoreServiceClient { + return &datastoreServiceClient{cc} +} + +func (c *datastoreServiceClient) Get(ctx context.Context, in *KeyMessage, opts ...grpc.CallOption) (*ObjectResponse, error) { + out := new(ObjectResponse) + err := c.cc.Invoke(ctx, "/datastore.DatastoreService/Get", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreServiceClient) Update(ctx context.Context, in *UpdateMessage, opts ...grpc.CallOption) (*ObjectResponse, error) { + out := new(ObjectResponse) + err := c.cc.Invoke(ctx, "/datastore.DatastoreService/Update", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *datastoreServiceClient) Delete(ctx context.Context, in *KeyMessage, opts ...grpc.CallOption) (*NullResponse, error) { + out := new(NullResponse) + err := c.cc.Invoke(ctx, "/datastore.DatastoreService/Delete", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DatastoreServiceServer is the server API for DatastoreService service. +// All implementations must embed UnimplementedDatastoreServiceServer +// for forward compatibility +type DatastoreServiceServer interface { + Get(context.Context, *KeyMessage) (*ObjectResponse, error) + Update(context.Context, *UpdateMessage) (*ObjectResponse, error) + Delete(context.Context, *KeyMessage) (*NullResponse, error) + mustEmbedUnimplementedDatastoreServiceServer() +} + +// UnimplementedDatastoreServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDatastoreServiceServer struct { +} + +func (UnimplementedDatastoreServiceServer) Get(context.Context, *KeyMessage) (*ObjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedDatastoreServiceServer) Update(context.Context, *UpdateMessage) (*ObjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") +} +func (UnimplementedDatastoreServiceServer) Delete(context.Context, *KeyMessage) (*NullResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} +func (UnimplementedDatastoreServiceServer) mustEmbedUnimplementedDatastoreServiceServer() {} + +// UnsafeDatastoreServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DatastoreServiceServer will +// result in compilation errors. +type UnsafeDatastoreServiceServer interface { + mustEmbedUnimplementedDatastoreServiceServer() +} + +func RegisterDatastoreServiceServer(s grpc.ServiceRegistrar, srv DatastoreServiceServer) { + s.RegisterService(&DatastoreService_ServiceDesc, srv) +} + +func _DatastoreService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KeyMessage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServiceServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/datastore.DatastoreService/Get", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServiceServer).Get(ctx, req.(*KeyMessage)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatastoreService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateMessage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServiceServer).Update(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/datastore.DatastoreService/Update", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServiceServer).Update(ctx, req.(*UpdateMessage)) + } + return interceptor(ctx, in, info, handler) +} + +func _DatastoreService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KeyMessage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DatastoreServiceServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/datastore.DatastoreService/Delete", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DatastoreServiceServer).Delete(ctx, req.(*KeyMessage)) + } + return interceptor(ctx, in, info, handler) +} + +// DatastoreService_ServiceDesc is the grpc.ServiceDesc for DatastoreService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DatastoreService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "datastore.DatastoreService", + HandlerType: (*DatastoreServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Get", + Handler: _DatastoreService_Get_Handler, + }, + { + MethodName: "Update", + Handler: _DatastoreService_Update_Handler, + }, + { + MethodName: "Delete", + Handler: _DatastoreService_Delete_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "datastore.proto", +}