github.com/tendermint/tmlibs@v0.9.0/db/remotedb/proto/defs.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // source: defs.proto 3 4 /* 5 Package protodb is a generated protocol buffer package. 6 7 It is generated from these files: 8 defs.proto 9 10 It has these top-level messages: 11 Batch 12 Operation 13 Entity 14 Nothing 15 Domain 16 Iterator 17 Stats 18 Init 19 */ 20 package protodb 21 22 import proto "github.com/golang/protobuf/proto" 23 import fmt "fmt" 24 import math "math" 25 26 import ( 27 context "golang.org/x/net/context" 28 grpc "google.golang.org/grpc" 29 ) 30 31 // Reference imports to suppress errors if they are not otherwise used. 32 var _ = proto.Marshal 33 var _ = fmt.Errorf 34 var _ = math.Inf 35 36 // This is a compile-time assertion to ensure that this generated file 37 // is compatible with the proto package it is being compiled against. 38 // A compilation error at this line likely means your copy of the 39 // proto package needs to be updated. 40 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 41 42 type Operation_Type int32 43 44 const ( 45 Operation_SET Operation_Type = 0 46 Operation_DELETE Operation_Type = 1 47 ) 48 49 var Operation_Type_name = map[int32]string{ 50 0: "SET", 51 1: "DELETE", 52 } 53 var Operation_Type_value = map[string]int32{ 54 "SET": 0, 55 "DELETE": 1, 56 } 57 58 func (x Operation_Type) String() string { 59 return proto.EnumName(Operation_Type_name, int32(x)) 60 } 61 func (Operation_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } 62 63 type Batch struct { 64 Ops []*Operation `protobuf:"bytes,1,rep,name=ops" json:"ops,omitempty"` 65 } 66 67 func (m *Batch) Reset() { *m = Batch{} } 68 func (m *Batch) String() string { return proto.CompactTextString(m) } 69 func (*Batch) ProtoMessage() {} 70 func (*Batch) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } 71 72 func (m *Batch) GetOps() []*Operation { 73 if m != nil { 74 return m.Ops 75 } 76 return nil 77 } 78 79 type Operation struct { 80 Entity *Entity `protobuf:"bytes,1,opt,name=entity" json:"entity,omitempty"` 81 Type Operation_Type `protobuf:"varint,2,opt,name=type,enum=protodb.Operation_Type" json:"type,omitempty"` 82 } 83 84 func (m *Operation) Reset() { *m = Operation{} } 85 func (m *Operation) String() string { return proto.CompactTextString(m) } 86 func (*Operation) ProtoMessage() {} 87 func (*Operation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } 88 89 func (m *Operation) GetEntity() *Entity { 90 if m != nil { 91 return m.Entity 92 } 93 return nil 94 } 95 96 func (m *Operation) GetType() Operation_Type { 97 if m != nil { 98 return m.Type 99 } 100 return Operation_SET 101 } 102 103 type Entity struct { 104 Id int32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` 105 Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` 106 Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` 107 Exists bool `protobuf:"varint,4,opt,name=exists" json:"exists,omitempty"` 108 Start []byte `protobuf:"bytes,5,opt,name=start,proto3" json:"start,omitempty"` 109 End []byte `protobuf:"bytes,6,opt,name=end,proto3" json:"end,omitempty"` 110 Err string `protobuf:"bytes,7,opt,name=err" json:"err,omitempty"` 111 CreatedAt int64 `protobuf:"varint,8,opt,name=created_at,json=createdAt" json:"created_at,omitempty"` 112 } 113 114 func (m *Entity) Reset() { *m = Entity{} } 115 func (m *Entity) String() string { return proto.CompactTextString(m) } 116 func (*Entity) ProtoMessage() {} 117 func (*Entity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } 118 119 func (m *Entity) GetId() int32 { 120 if m != nil { 121 return m.Id 122 } 123 return 0 124 } 125 126 func (m *Entity) GetKey() []byte { 127 if m != nil { 128 return m.Key 129 } 130 return nil 131 } 132 133 func (m *Entity) GetValue() []byte { 134 if m != nil { 135 return m.Value 136 } 137 return nil 138 } 139 140 func (m *Entity) GetExists() bool { 141 if m != nil { 142 return m.Exists 143 } 144 return false 145 } 146 147 func (m *Entity) GetStart() []byte { 148 if m != nil { 149 return m.Start 150 } 151 return nil 152 } 153 154 func (m *Entity) GetEnd() []byte { 155 if m != nil { 156 return m.End 157 } 158 return nil 159 } 160 161 func (m *Entity) GetErr() string { 162 if m != nil { 163 return m.Err 164 } 165 return "" 166 } 167 168 func (m *Entity) GetCreatedAt() int64 { 169 if m != nil { 170 return m.CreatedAt 171 } 172 return 0 173 } 174 175 type Nothing struct { 176 } 177 178 func (m *Nothing) Reset() { *m = Nothing{} } 179 func (m *Nothing) String() string { return proto.CompactTextString(m) } 180 func (*Nothing) ProtoMessage() {} 181 func (*Nothing) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } 182 183 type Domain struct { 184 Start []byte `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"` 185 End []byte `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"` 186 } 187 188 func (m *Domain) Reset() { *m = Domain{} } 189 func (m *Domain) String() string { return proto.CompactTextString(m) } 190 func (*Domain) ProtoMessage() {} 191 func (*Domain) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } 192 193 func (m *Domain) GetStart() []byte { 194 if m != nil { 195 return m.Start 196 } 197 return nil 198 } 199 200 func (m *Domain) GetEnd() []byte { 201 if m != nil { 202 return m.End 203 } 204 return nil 205 } 206 207 type Iterator struct { 208 Domain *Domain `protobuf:"bytes,1,opt,name=domain" json:"domain,omitempty"` 209 Valid bool `protobuf:"varint,2,opt,name=valid" json:"valid,omitempty"` 210 Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` 211 Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` 212 } 213 214 func (m *Iterator) Reset() { *m = Iterator{} } 215 func (m *Iterator) String() string { return proto.CompactTextString(m) } 216 func (*Iterator) ProtoMessage() {} 217 func (*Iterator) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } 218 219 func (m *Iterator) GetDomain() *Domain { 220 if m != nil { 221 return m.Domain 222 } 223 return nil 224 } 225 226 func (m *Iterator) GetValid() bool { 227 if m != nil { 228 return m.Valid 229 } 230 return false 231 } 232 233 func (m *Iterator) GetKey() []byte { 234 if m != nil { 235 return m.Key 236 } 237 return nil 238 } 239 240 func (m *Iterator) GetValue() []byte { 241 if m != nil { 242 return m.Value 243 } 244 return nil 245 } 246 247 type Stats struct { 248 Data map[string]string `protobuf:"bytes,1,rep,name=data" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` 249 TimeAt int64 `protobuf:"varint,2,opt,name=time_at,json=timeAt" json:"time_at,omitempty"` 250 } 251 252 func (m *Stats) Reset() { *m = Stats{} } 253 func (m *Stats) String() string { return proto.CompactTextString(m) } 254 func (*Stats) ProtoMessage() {} 255 func (*Stats) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } 256 257 func (m *Stats) GetData() map[string]string { 258 if m != nil { 259 return m.Data 260 } 261 return nil 262 } 263 264 func (m *Stats) GetTimeAt() int64 { 265 if m != nil { 266 return m.TimeAt 267 } 268 return 0 269 } 270 271 type Init struct { 272 Type string `protobuf:"bytes,1,opt,name=Type" json:"Type,omitempty"` 273 Name string `protobuf:"bytes,2,opt,name=Name" json:"Name,omitempty"` 274 Dir string `protobuf:"bytes,3,opt,name=Dir" json:"Dir,omitempty"` 275 } 276 277 func (m *Init) Reset() { *m = Init{} } 278 func (m *Init) String() string { return proto.CompactTextString(m) } 279 func (*Init) ProtoMessage() {} 280 func (*Init) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } 281 282 func (m *Init) GetType() string { 283 if m != nil { 284 return m.Type 285 } 286 return "" 287 } 288 289 func (m *Init) GetName() string { 290 if m != nil { 291 return m.Name 292 } 293 return "" 294 } 295 296 func (m *Init) GetDir() string { 297 if m != nil { 298 return m.Dir 299 } 300 return "" 301 } 302 303 func init() { 304 proto.RegisterType((*Batch)(nil), "protodb.Batch") 305 proto.RegisterType((*Operation)(nil), "protodb.Operation") 306 proto.RegisterType((*Entity)(nil), "protodb.Entity") 307 proto.RegisterType((*Nothing)(nil), "protodb.Nothing") 308 proto.RegisterType((*Domain)(nil), "protodb.Domain") 309 proto.RegisterType((*Iterator)(nil), "protodb.Iterator") 310 proto.RegisterType((*Stats)(nil), "protodb.Stats") 311 proto.RegisterType((*Init)(nil), "protodb.Init") 312 proto.RegisterEnum("protodb.Operation_Type", Operation_Type_name, Operation_Type_value) 313 } 314 315 // Reference imports to suppress errors if they are not otherwise used. 316 var _ context.Context 317 var _ grpc.ClientConn 318 319 // This is a compile-time assertion to ensure that this generated file 320 // is compatible with the grpc package it is being compiled against. 321 const _ = grpc.SupportPackageIsVersion4 322 323 // Client API for DB service 324 325 type DBClient interface { 326 Init(ctx context.Context, in *Init, opts ...grpc.CallOption) (*Entity, error) 327 Get(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Entity, error) 328 GetStream(ctx context.Context, opts ...grpc.CallOption) (DB_GetStreamClient, error) 329 Has(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Entity, error) 330 Set(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Nothing, error) 331 SetSync(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Nothing, error) 332 Delete(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Nothing, error) 333 DeleteSync(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Nothing, error) 334 Iterator(ctx context.Context, in *Entity, opts ...grpc.CallOption) (DB_IteratorClient, error) 335 ReverseIterator(ctx context.Context, in *Entity, opts ...grpc.CallOption) (DB_ReverseIteratorClient, error) 336 // rpc print(Nothing) returns (Entity) {} 337 Stats(ctx context.Context, in *Nothing, opts ...grpc.CallOption) (*Stats, error) 338 BatchWrite(ctx context.Context, in *Batch, opts ...grpc.CallOption) (*Nothing, error) 339 BatchWriteSync(ctx context.Context, in *Batch, opts ...grpc.CallOption) (*Nothing, error) 340 } 341 342 type dBClient struct { 343 cc *grpc.ClientConn 344 } 345 346 func NewDBClient(cc *grpc.ClientConn) DBClient { 347 return &dBClient{cc} 348 } 349 350 func (c *dBClient) Init(ctx context.Context, in *Init, opts ...grpc.CallOption) (*Entity, error) { 351 out := new(Entity) 352 err := grpc.Invoke(ctx, "/protodb.DB/init", in, out, c.cc, opts...) 353 if err != nil { 354 return nil, err 355 } 356 return out, nil 357 } 358 359 func (c *dBClient) Get(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Entity, error) { 360 out := new(Entity) 361 err := grpc.Invoke(ctx, "/protodb.DB/get", in, out, c.cc, opts...) 362 if err != nil { 363 return nil, err 364 } 365 return out, nil 366 } 367 368 func (c *dBClient) GetStream(ctx context.Context, opts ...grpc.CallOption) (DB_GetStreamClient, error) { 369 stream, err := grpc.NewClientStream(ctx, &_DB_serviceDesc.Streams[0], c.cc, "/protodb.DB/getStream", opts...) 370 if err != nil { 371 return nil, err 372 } 373 x := &dBGetStreamClient{stream} 374 return x, nil 375 } 376 377 type DB_GetStreamClient interface { 378 Send(*Entity) error 379 Recv() (*Entity, error) 380 grpc.ClientStream 381 } 382 383 type dBGetStreamClient struct { 384 grpc.ClientStream 385 } 386 387 func (x *dBGetStreamClient) Send(m *Entity) error { 388 return x.ClientStream.SendMsg(m) 389 } 390 391 func (x *dBGetStreamClient) Recv() (*Entity, error) { 392 m := new(Entity) 393 if err := x.ClientStream.RecvMsg(m); err != nil { 394 return nil, err 395 } 396 return m, nil 397 } 398 399 func (c *dBClient) Has(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Entity, error) { 400 out := new(Entity) 401 err := grpc.Invoke(ctx, "/protodb.DB/has", in, out, c.cc, opts...) 402 if err != nil { 403 return nil, err 404 } 405 return out, nil 406 } 407 408 func (c *dBClient) Set(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Nothing, error) { 409 out := new(Nothing) 410 err := grpc.Invoke(ctx, "/protodb.DB/set", in, out, c.cc, opts...) 411 if err != nil { 412 return nil, err 413 } 414 return out, nil 415 } 416 417 func (c *dBClient) SetSync(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Nothing, error) { 418 out := new(Nothing) 419 err := grpc.Invoke(ctx, "/protodb.DB/setSync", in, out, c.cc, opts...) 420 if err != nil { 421 return nil, err 422 } 423 return out, nil 424 } 425 426 func (c *dBClient) Delete(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Nothing, error) { 427 out := new(Nothing) 428 err := grpc.Invoke(ctx, "/protodb.DB/delete", in, out, c.cc, opts...) 429 if err != nil { 430 return nil, err 431 } 432 return out, nil 433 } 434 435 func (c *dBClient) DeleteSync(ctx context.Context, in *Entity, opts ...grpc.CallOption) (*Nothing, error) { 436 out := new(Nothing) 437 err := grpc.Invoke(ctx, "/protodb.DB/deleteSync", in, out, c.cc, opts...) 438 if err != nil { 439 return nil, err 440 } 441 return out, nil 442 } 443 444 func (c *dBClient) Iterator(ctx context.Context, in *Entity, opts ...grpc.CallOption) (DB_IteratorClient, error) { 445 stream, err := grpc.NewClientStream(ctx, &_DB_serviceDesc.Streams[1], c.cc, "/protodb.DB/iterator", opts...) 446 if err != nil { 447 return nil, err 448 } 449 x := &dBIteratorClient{stream} 450 if err := x.ClientStream.SendMsg(in); err != nil { 451 return nil, err 452 } 453 if err := x.ClientStream.CloseSend(); err != nil { 454 return nil, err 455 } 456 return x, nil 457 } 458 459 type DB_IteratorClient interface { 460 Recv() (*Iterator, error) 461 grpc.ClientStream 462 } 463 464 type dBIteratorClient struct { 465 grpc.ClientStream 466 } 467 468 func (x *dBIteratorClient) Recv() (*Iterator, error) { 469 m := new(Iterator) 470 if err := x.ClientStream.RecvMsg(m); err != nil { 471 return nil, err 472 } 473 return m, nil 474 } 475 476 func (c *dBClient) ReverseIterator(ctx context.Context, in *Entity, opts ...grpc.CallOption) (DB_ReverseIteratorClient, error) { 477 stream, err := grpc.NewClientStream(ctx, &_DB_serviceDesc.Streams[2], c.cc, "/protodb.DB/reverseIterator", opts...) 478 if err != nil { 479 return nil, err 480 } 481 x := &dBReverseIteratorClient{stream} 482 if err := x.ClientStream.SendMsg(in); err != nil { 483 return nil, err 484 } 485 if err := x.ClientStream.CloseSend(); err != nil { 486 return nil, err 487 } 488 return x, nil 489 } 490 491 type DB_ReverseIteratorClient interface { 492 Recv() (*Iterator, error) 493 grpc.ClientStream 494 } 495 496 type dBReverseIteratorClient struct { 497 grpc.ClientStream 498 } 499 500 func (x *dBReverseIteratorClient) Recv() (*Iterator, error) { 501 m := new(Iterator) 502 if err := x.ClientStream.RecvMsg(m); err != nil { 503 return nil, err 504 } 505 return m, nil 506 } 507 508 func (c *dBClient) Stats(ctx context.Context, in *Nothing, opts ...grpc.CallOption) (*Stats, error) { 509 out := new(Stats) 510 err := grpc.Invoke(ctx, "/protodb.DB/stats", in, out, c.cc, opts...) 511 if err != nil { 512 return nil, err 513 } 514 return out, nil 515 } 516 517 func (c *dBClient) BatchWrite(ctx context.Context, in *Batch, opts ...grpc.CallOption) (*Nothing, error) { 518 out := new(Nothing) 519 err := grpc.Invoke(ctx, "/protodb.DB/batchWrite", in, out, c.cc, opts...) 520 if err != nil { 521 return nil, err 522 } 523 return out, nil 524 } 525 526 func (c *dBClient) BatchWriteSync(ctx context.Context, in *Batch, opts ...grpc.CallOption) (*Nothing, error) { 527 out := new(Nothing) 528 err := grpc.Invoke(ctx, "/protodb.DB/batchWriteSync", in, out, c.cc, opts...) 529 if err != nil { 530 return nil, err 531 } 532 return out, nil 533 } 534 535 // Server API for DB service 536 537 type DBServer interface { 538 Init(context.Context, *Init) (*Entity, error) 539 Get(context.Context, *Entity) (*Entity, error) 540 GetStream(DB_GetStreamServer) error 541 Has(context.Context, *Entity) (*Entity, error) 542 Set(context.Context, *Entity) (*Nothing, error) 543 SetSync(context.Context, *Entity) (*Nothing, error) 544 Delete(context.Context, *Entity) (*Nothing, error) 545 DeleteSync(context.Context, *Entity) (*Nothing, error) 546 Iterator(*Entity, DB_IteratorServer) error 547 ReverseIterator(*Entity, DB_ReverseIteratorServer) error 548 // rpc print(Nothing) returns (Entity) {} 549 Stats(context.Context, *Nothing) (*Stats, error) 550 BatchWrite(context.Context, *Batch) (*Nothing, error) 551 BatchWriteSync(context.Context, *Batch) (*Nothing, error) 552 } 553 554 func RegisterDBServer(s *grpc.Server, srv DBServer) { 555 s.RegisterService(&_DB_serviceDesc, srv) 556 } 557 558 func _DB_Init_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 559 in := new(Init) 560 if err := dec(in); err != nil { 561 return nil, err 562 } 563 if interceptor == nil { 564 return srv.(DBServer).Init(ctx, in) 565 } 566 info := &grpc.UnaryServerInfo{ 567 Server: srv, 568 FullMethod: "/protodb.DB/Init", 569 } 570 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 571 return srv.(DBServer).Init(ctx, req.(*Init)) 572 } 573 return interceptor(ctx, in, info, handler) 574 } 575 576 func _DB_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 577 in := new(Entity) 578 if err := dec(in); err != nil { 579 return nil, err 580 } 581 if interceptor == nil { 582 return srv.(DBServer).Get(ctx, in) 583 } 584 info := &grpc.UnaryServerInfo{ 585 Server: srv, 586 FullMethod: "/protodb.DB/Get", 587 } 588 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 589 return srv.(DBServer).Get(ctx, req.(*Entity)) 590 } 591 return interceptor(ctx, in, info, handler) 592 } 593 594 func _DB_GetStream_Handler(srv interface{}, stream grpc.ServerStream) error { 595 return srv.(DBServer).GetStream(&dBGetStreamServer{stream}) 596 } 597 598 type DB_GetStreamServer interface { 599 Send(*Entity) error 600 Recv() (*Entity, error) 601 grpc.ServerStream 602 } 603 604 type dBGetStreamServer struct { 605 grpc.ServerStream 606 } 607 608 func (x *dBGetStreamServer) Send(m *Entity) error { 609 return x.ServerStream.SendMsg(m) 610 } 611 612 func (x *dBGetStreamServer) Recv() (*Entity, error) { 613 m := new(Entity) 614 if err := x.ServerStream.RecvMsg(m); err != nil { 615 return nil, err 616 } 617 return m, nil 618 } 619 620 func _DB_Has_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 621 in := new(Entity) 622 if err := dec(in); err != nil { 623 return nil, err 624 } 625 if interceptor == nil { 626 return srv.(DBServer).Has(ctx, in) 627 } 628 info := &grpc.UnaryServerInfo{ 629 Server: srv, 630 FullMethod: "/protodb.DB/Has", 631 } 632 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 633 return srv.(DBServer).Has(ctx, req.(*Entity)) 634 } 635 return interceptor(ctx, in, info, handler) 636 } 637 638 func _DB_Set_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 639 in := new(Entity) 640 if err := dec(in); err != nil { 641 return nil, err 642 } 643 if interceptor == nil { 644 return srv.(DBServer).Set(ctx, in) 645 } 646 info := &grpc.UnaryServerInfo{ 647 Server: srv, 648 FullMethod: "/protodb.DB/Set", 649 } 650 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 651 return srv.(DBServer).Set(ctx, req.(*Entity)) 652 } 653 return interceptor(ctx, in, info, handler) 654 } 655 656 func _DB_SetSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 657 in := new(Entity) 658 if err := dec(in); err != nil { 659 return nil, err 660 } 661 if interceptor == nil { 662 return srv.(DBServer).SetSync(ctx, in) 663 } 664 info := &grpc.UnaryServerInfo{ 665 Server: srv, 666 FullMethod: "/protodb.DB/SetSync", 667 } 668 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 669 return srv.(DBServer).SetSync(ctx, req.(*Entity)) 670 } 671 return interceptor(ctx, in, info, handler) 672 } 673 674 func _DB_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 675 in := new(Entity) 676 if err := dec(in); err != nil { 677 return nil, err 678 } 679 if interceptor == nil { 680 return srv.(DBServer).Delete(ctx, in) 681 } 682 info := &grpc.UnaryServerInfo{ 683 Server: srv, 684 FullMethod: "/protodb.DB/Delete", 685 } 686 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 687 return srv.(DBServer).Delete(ctx, req.(*Entity)) 688 } 689 return interceptor(ctx, in, info, handler) 690 } 691 692 func _DB_DeleteSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 693 in := new(Entity) 694 if err := dec(in); err != nil { 695 return nil, err 696 } 697 if interceptor == nil { 698 return srv.(DBServer).DeleteSync(ctx, in) 699 } 700 info := &grpc.UnaryServerInfo{ 701 Server: srv, 702 FullMethod: "/protodb.DB/DeleteSync", 703 } 704 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 705 return srv.(DBServer).DeleteSync(ctx, req.(*Entity)) 706 } 707 return interceptor(ctx, in, info, handler) 708 } 709 710 func _DB_Iterator_Handler(srv interface{}, stream grpc.ServerStream) error { 711 m := new(Entity) 712 if err := stream.RecvMsg(m); err != nil { 713 return err 714 } 715 return srv.(DBServer).Iterator(m, &dBIteratorServer{stream}) 716 } 717 718 type DB_IteratorServer interface { 719 Send(*Iterator) error 720 grpc.ServerStream 721 } 722 723 type dBIteratorServer struct { 724 grpc.ServerStream 725 } 726 727 func (x *dBIteratorServer) Send(m *Iterator) error { 728 return x.ServerStream.SendMsg(m) 729 } 730 731 func _DB_ReverseIterator_Handler(srv interface{}, stream grpc.ServerStream) error { 732 m := new(Entity) 733 if err := stream.RecvMsg(m); err != nil { 734 return err 735 } 736 return srv.(DBServer).ReverseIterator(m, &dBReverseIteratorServer{stream}) 737 } 738 739 type DB_ReverseIteratorServer interface { 740 Send(*Iterator) error 741 grpc.ServerStream 742 } 743 744 type dBReverseIteratorServer struct { 745 grpc.ServerStream 746 } 747 748 func (x *dBReverseIteratorServer) Send(m *Iterator) error { 749 return x.ServerStream.SendMsg(m) 750 } 751 752 func _DB_Stats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 753 in := new(Nothing) 754 if err := dec(in); err != nil { 755 return nil, err 756 } 757 if interceptor == nil { 758 return srv.(DBServer).Stats(ctx, in) 759 } 760 info := &grpc.UnaryServerInfo{ 761 Server: srv, 762 FullMethod: "/protodb.DB/Stats", 763 } 764 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 765 return srv.(DBServer).Stats(ctx, req.(*Nothing)) 766 } 767 return interceptor(ctx, in, info, handler) 768 } 769 770 func _DB_BatchWrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 771 in := new(Batch) 772 if err := dec(in); err != nil { 773 return nil, err 774 } 775 if interceptor == nil { 776 return srv.(DBServer).BatchWrite(ctx, in) 777 } 778 info := &grpc.UnaryServerInfo{ 779 Server: srv, 780 FullMethod: "/protodb.DB/BatchWrite", 781 } 782 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 783 return srv.(DBServer).BatchWrite(ctx, req.(*Batch)) 784 } 785 return interceptor(ctx, in, info, handler) 786 } 787 788 func _DB_BatchWriteSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 789 in := new(Batch) 790 if err := dec(in); err != nil { 791 return nil, err 792 } 793 if interceptor == nil { 794 return srv.(DBServer).BatchWriteSync(ctx, in) 795 } 796 info := &grpc.UnaryServerInfo{ 797 Server: srv, 798 FullMethod: "/protodb.DB/BatchWriteSync", 799 } 800 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 801 return srv.(DBServer).BatchWriteSync(ctx, req.(*Batch)) 802 } 803 return interceptor(ctx, in, info, handler) 804 } 805 806 var _DB_serviceDesc = grpc.ServiceDesc{ 807 ServiceName: "protodb.DB", 808 HandlerType: (*DBServer)(nil), 809 Methods: []grpc.MethodDesc{ 810 { 811 MethodName: "init", 812 Handler: _DB_Init_Handler, 813 }, 814 { 815 MethodName: "get", 816 Handler: _DB_Get_Handler, 817 }, 818 { 819 MethodName: "has", 820 Handler: _DB_Has_Handler, 821 }, 822 { 823 MethodName: "set", 824 Handler: _DB_Set_Handler, 825 }, 826 { 827 MethodName: "setSync", 828 Handler: _DB_SetSync_Handler, 829 }, 830 { 831 MethodName: "delete", 832 Handler: _DB_Delete_Handler, 833 }, 834 { 835 MethodName: "deleteSync", 836 Handler: _DB_DeleteSync_Handler, 837 }, 838 { 839 MethodName: "stats", 840 Handler: _DB_Stats_Handler, 841 }, 842 { 843 MethodName: "batchWrite", 844 Handler: _DB_BatchWrite_Handler, 845 }, 846 { 847 MethodName: "batchWriteSync", 848 Handler: _DB_BatchWriteSync_Handler, 849 }, 850 }, 851 Streams: []grpc.StreamDesc{ 852 { 853 StreamName: "getStream", 854 Handler: _DB_GetStream_Handler, 855 ServerStreams: true, 856 ClientStreams: true, 857 }, 858 { 859 StreamName: "iterator", 860 Handler: _DB_Iterator_Handler, 861 ServerStreams: true, 862 }, 863 { 864 StreamName: "reverseIterator", 865 Handler: _DB_ReverseIterator_Handler, 866 ServerStreams: true, 867 }, 868 }, 869 Metadata: "defs.proto", 870 } 871 872 func init() { proto.RegisterFile("defs.proto", fileDescriptor0) } 873 874 var fileDescriptor0 = []byte{ 875 // 606 bytes of a gzipped FileDescriptorProto 876 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x4f, 0x6f, 0xd3, 0x4e, 877 0x10, 0xcd, 0xda, 0x8e, 0x13, 0x4f, 0x7f, 0xbf, 0x34, 0x8c, 0x10, 0xb5, 0x8a, 0x90, 0x22, 0x0b, 878 0x09, 0x43, 0x69, 0x14, 0x52, 0x24, 0xfe, 0x9c, 0x68, 0x95, 0x1c, 0x2a, 0xa1, 0x22, 0x39, 0x95, 879 0x38, 0xa2, 0x6d, 0x3d, 0x34, 0x2b, 0x1a, 0x3b, 0xac, 0x87, 0x8a, 0x5c, 0xb8, 0xf2, 0x79, 0xf8, 880 0x7c, 0x5c, 0xd0, 0xae, 0x1d, 0x87, 0x36, 0x39, 0x84, 0x53, 0x76, 0x66, 0xde, 0x7b, 0xb3, 0xf3, 881 0x32, 0x5e, 0x80, 0x94, 0x3e, 0x17, 0xfd, 0xb9, 0xce, 0x39, 0xc7, 0x96, 0xfd, 0x49, 0x2f, 0xa2, 882 0x43, 0x68, 0x9e, 0x48, 0xbe, 0x9c, 0xe2, 0x63, 0x70, 0xf3, 0x79, 0x11, 0x8a, 0x9e, 0x1b, 0xef, 883 0x0c, 0xb1, 0x5f, 0xd5, 0xfb, 0x1f, 0xe6, 0xa4, 0x25, 0xab, 0x3c, 0x4b, 0x4c, 0x39, 0xfa, 0x01, 884 0x41, 0x9d, 0xc1, 0x27, 0xe0, 0x53, 0xc6, 0x8a, 0x17, 0xa1, 0xe8, 0x89, 0x78, 0x67, 0xb8, 0x5b, 885 0xb3, 0xc6, 0x36, 0x9d, 0x54, 0x65, 0x3c, 0x00, 0x8f, 0x17, 0x73, 0x0a, 0x9d, 0x9e, 0x88, 0x3b, 886 0xc3, 0xbd, 0x75, 0xf1, 0xfe, 0xf9, 0x62, 0x4e, 0x89, 0x05, 0x45, 0x0f, 0xc1, 0x33, 0x11, 0xb6, 887 0xc0, 0x9d, 0x8c, 0xcf, 0xbb, 0x0d, 0x04, 0xf0, 0x47, 0xe3, 0xf7, 0xe3, 0xf3, 0x71, 0x57, 0x44, 888 0xbf, 0x04, 0xf8, 0xa5, 0x38, 0x76, 0xc0, 0x51, 0xa9, 0xed, 0xdc, 0x4c, 0x1c, 0x95, 0x62, 0x17, 889 0xdc, 0x2f, 0xb4, 0xb0, 0x3d, 0xfe, 0x4b, 0xcc, 0x11, 0xef, 0x43, 0xf3, 0x46, 0x5e, 0x7f, 0xa3, 890 0xd0, 0xb5, 0xb9, 0x32, 0xc0, 0x07, 0xe0, 0xd3, 0x77, 0x55, 0x70, 0x11, 0x7a, 0x3d, 0x11, 0xb7, 891 0x93, 0x2a, 0x32, 0xe8, 0x82, 0xa5, 0xe6, 0xb0, 0x59, 0xa2, 0x6d, 0x60, 0x54, 0x29, 0x4b, 0x43, 892 0xbf, 0x54, 0xa5, 0xcc, 0xf6, 0x21, 0xad, 0xc3, 0x56, 0x4f, 0xc4, 0x41, 0x62, 0x8e, 0xf8, 0x08, 893 0xe0, 0x52, 0x93, 0x64, 0x4a, 0x3f, 0x49, 0x0e, 0xdb, 0x3d, 0x11, 0xbb, 0x49, 0x50, 0x65, 0x8e, 894 0x39, 0x0a, 0xa0, 0x75, 0x96, 0xf3, 0x54, 0x65, 0x57, 0xd1, 0x00, 0xfc, 0x51, 0x3e, 0x93, 0x2a, 895 0x5b, 0x75, 0x13, 0x1b, 0xba, 0x39, 0x75, 0xb7, 0xe8, 0x2b, 0xb4, 0x4f, 0xd9, 0xb8, 0x94, 0x6b, 896 0xe3, 0x77, 0x6a, 0xd9, 0x6b, 0x7e, 0x97, 0xa2, 0x49, 0x55, 0xae, 0x06, 0x57, 0xa5, 0x50, 0x3b, 897 0x29, 0x83, 0xa5, 0x41, 0xee, 0x06, 0x83, 0xbc, 0xbf, 0x0c, 0x8a, 0x7e, 0x0a, 0x68, 0x4e, 0x58, 898 0x72, 0x81, 0xcf, 0xc1, 0x4b, 0x25, 0xcb, 0x6a, 0x29, 0xc2, 0xba, 0x9d, 0xad, 0xf6, 0x47, 0x92, 899 0xe5, 0x38, 0x63, 0xbd, 0x48, 0x2c, 0x0a, 0xf7, 0xa0, 0xc5, 0x6a, 0x46, 0xc6, 0x03, 0xc7, 0x7a, 900 0xe0, 0x9b, 0xf0, 0x98, 0xf7, 0x5f, 0x41, 0x50, 0x63, 0x97, 0xb7, 0x10, 0xa5, 0x7d, 0xb7, 0x6e, 901 0xe1, 0xd8, 0x5c, 0x19, 0xbc, 0x75, 0x5e, 0x8b, 0xe8, 0x1d, 0x78, 0xa7, 0x99, 0x62, 0xc4, 0x72, 902 0x25, 0x2a, 0x52, 0xb9, 0x1e, 0x08, 0xde, 0x99, 0x9c, 0x2d, 0x49, 0xf6, 0x6c, 0xb4, 0x47, 0x4a, 903 0xdb, 0x09, 0x83, 0xc4, 0x1c, 0x87, 0xbf, 0x3d, 0x70, 0x46, 0x27, 0x18, 0x83, 0xa7, 0x8c, 0xd0, 904 0xff, 0xf5, 0x08, 0x46, 0x77, 0xff, 0xee, 0xc2, 0x46, 0x0d, 0x7c, 0x0a, 0xee, 0x15, 0x31, 0xde, 905 0xad, 0x6c, 0x82, 0x1e, 0x41, 0x70, 0x45, 0x3c, 0x61, 0x4d, 0x72, 0xb6, 0x0d, 0x21, 0x16, 0x03, 906 0x61, 0xf4, 0xa7, 0xb2, 0xd8, 0x4a, 0xff, 0x19, 0xb8, 0xc5, 0xa6, 0xab, 0x74, 0xeb, 0xc4, 0x72, 907 0xad, 0x1a, 0xd8, 0x87, 0x56, 0x41, 0x3c, 0x59, 0x64, 0x97, 0xdb, 0xe1, 0x0f, 0xc1, 0x4f, 0xe9, 908 0x9a, 0x98, 0xb6, 0x83, 0xbf, 0x30, 0x8f, 0x87, 0x81, 0x6f, 0xdf, 0x61, 0x08, 0x6d, 0xb5, 0x5c, 909 0xdc, 0x35, 0xc2, 0xbd, 0xd5, 0xff, 0x50, 0x61, 0xa2, 0xc6, 0x40, 0xe0, 0x1b, 0xd8, 0xd5, 0x74, 910 0x43, 0xba, 0xa0, 0xd3, 0x7f, 0xa5, 0x1e, 0xd8, 0xef, 0x89, 0x0b, 0x5c, 0xbb, 0xcb, 0x7e, 0xe7, 911 0xf6, 0xde, 0x46, 0x0d, 0x1c, 0x00, 0x5c, 0x98, 0x47, 0xef, 0xa3, 0x56, 0x4c, 0xb8, 0xaa, 0xdb, 912 0x97, 0x70, 0xe3, 0x34, 0x2f, 0xa1, 0xb3, 0x62, 0x58, 0x13, 0xb6, 0x60, 0x5d, 0xf8, 0x36, 0x75, 913 0xf4, 0x27, 0x00, 0x00, 0xff, 0xff, 0x95, 0xf4, 0xe3, 0x82, 0x7a, 0x05, 0x00, 0x00, 914 }