You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

914 lines
27 KiB

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