github.com/ledgerwatch/erigon-lib@v1.0.0/gointerfaces/remote/mocks.go (about) 1 // Code generated by moq; DO NOT EDIT. 2 // github.com/matryer/moq 3 4 package remote 5 6 import ( 7 context "context" 8 types "github.com/ledgerwatch/erigon-lib/gointerfaces/types" 9 grpc "google.golang.org/grpc" 10 "google.golang.org/grpc/metadata" 11 emptypb "google.golang.org/protobuf/types/known/emptypb" 12 sync "sync" 13 ) 14 15 // Ensure, that KVClientMock does implement KVClient. 16 // If this is not the case, regenerate this file with moq. 17 var _ KVClient = &KVClientMock{} 18 19 // KVClientMock is a mock implementation of KVClient. 20 // 21 // func TestSomethingThatUsesKVClient(t *testing.T) { 22 // 23 // // make and configure a mocked KVClient 24 // mockedKVClient := &KVClientMock{ 25 // DomainGetFunc: func(ctx context.Context, in *DomainGetReq, opts ...grpc.CallOption) (*DomainGetReply, error) { 26 // panic("mock out the DomainGet method") 27 // }, 28 // DomainRangeFunc: func(ctx context.Context, in *DomainRangeReq, opts ...grpc.CallOption) (*Pairs, error) { 29 // panic("mock out the DomainRange method") 30 // }, 31 // HistoryGetFunc: func(ctx context.Context, in *HistoryGetReq, opts ...grpc.CallOption) (*HistoryGetReply, error) { 32 // panic("mock out the HistoryGet method") 33 // }, 34 // HistoryRangeFunc: func(ctx context.Context, in *HistoryRangeReq, opts ...grpc.CallOption) (*Pairs, error) { 35 // panic("mock out the HistoryRange method") 36 // }, 37 // IndexRangeFunc: func(ctx context.Context, in *IndexRangeReq, opts ...grpc.CallOption) (*IndexRangeReply, error) { 38 // panic("mock out the IndexRange method") 39 // }, 40 // RangeFunc: func(ctx context.Context, in *RangeReq, opts ...grpc.CallOption) (*Pairs, error) { 41 // panic("mock out the Range method") 42 // }, 43 // SnapshotsFunc: func(ctx context.Context, in *SnapshotsRequest, opts ...grpc.CallOption) (*SnapshotsReply, error) { 44 // panic("mock out the Snapshots method") 45 // }, 46 // StateChangesFunc: func(ctx context.Context, in *StateChangeRequest, opts ...grpc.CallOption) (KV_StateChangesClient, error) { 47 // panic("mock out the StateChanges method") 48 // }, 49 // TxFunc: func(ctx context.Context, opts ...grpc.CallOption) (KV_TxClient, error) { 50 // panic("mock out the Tx method") 51 // }, 52 // VersionFunc: func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.VersionReply, error) { 53 // panic("mock out the Version method") 54 // }, 55 // } 56 // 57 // // use mockedKVClient in code that requires KVClient 58 // // and then make assertions. 59 // 60 // } 61 type KVClientMock struct { 62 // DomainGetFunc mocks the DomainGet method. 63 DomainGetFunc func(ctx context.Context, in *DomainGetReq, opts ...grpc.CallOption) (*DomainGetReply, error) 64 65 // DomainRangeFunc mocks the DomainRange method. 66 DomainRangeFunc func(ctx context.Context, in *DomainRangeReq, opts ...grpc.CallOption) (*Pairs, error) 67 68 // HistoryGetFunc mocks the HistoryGet method. 69 HistoryGetFunc func(ctx context.Context, in *HistoryGetReq, opts ...grpc.CallOption) (*HistoryGetReply, error) 70 71 // HistoryRangeFunc mocks the HistoryRange method. 72 HistoryRangeFunc func(ctx context.Context, in *HistoryRangeReq, opts ...grpc.CallOption) (*Pairs, error) 73 74 // IndexRangeFunc mocks the IndexRange method. 75 IndexRangeFunc func(ctx context.Context, in *IndexRangeReq, opts ...grpc.CallOption) (*IndexRangeReply, error) 76 77 // RangeFunc mocks the Range method. 78 RangeFunc func(ctx context.Context, in *RangeReq, opts ...grpc.CallOption) (*Pairs, error) 79 80 // SnapshotsFunc mocks the Snapshots method. 81 SnapshotsFunc func(ctx context.Context, in *SnapshotsRequest, opts ...grpc.CallOption) (*SnapshotsReply, error) 82 83 // StateChangesFunc mocks the StateChanges method. 84 StateChangesFunc func(ctx context.Context, in *StateChangeRequest, opts ...grpc.CallOption) (KV_StateChangesClient, error) 85 86 // TxFunc mocks the Tx method. 87 TxFunc func(ctx context.Context, opts ...grpc.CallOption) (KV_TxClient, error) 88 89 // VersionFunc mocks the Version method. 90 VersionFunc func(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.VersionReply, error) 91 92 // calls tracks calls to the methods. 93 calls struct { 94 // DomainGet holds details about calls to the DomainGet method. 95 DomainGet []struct { 96 // Ctx is the ctx argument value. 97 Ctx context.Context 98 // In is the in argument value. 99 In *DomainGetReq 100 // Opts is the opts argument value. 101 Opts []grpc.CallOption 102 } 103 // DomainRange holds details about calls to the DomainRange method. 104 DomainRange []struct { 105 // Ctx is the ctx argument value. 106 Ctx context.Context 107 // In is the in argument value. 108 In *DomainRangeReq 109 // Opts is the opts argument value. 110 Opts []grpc.CallOption 111 } 112 // HistoryGet holds details about calls to the HistoryGet method. 113 HistoryGet []struct { 114 // Ctx is the ctx argument value. 115 Ctx context.Context 116 // In is the in argument value. 117 In *HistoryGetReq 118 // Opts is the opts argument value. 119 Opts []grpc.CallOption 120 } 121 // HistoryRange holds details about calls to the HistoryRange method. 122 HistoryRange []struct { 123 // Ctx is the ctx argument value. 124 Ctx context.Context 125 // In is the in argument value. 126 In *HistoryRangeReq 127 // Opts is the opts argument value. 128 Opts []grpc.CallOption 129 } 130 // IndexRange holds details about calls to the IndexRange method. 131 IndexRange []struct { 132 // Ctx is the ctx argument value. 133 Ctx context.Context 134 // In is the in argument value. 135 In *IndexRangeReq 136 // Opts is the opts argument value. 137 Opts []grpc.CallOption 138 } 139 // Range holds details about calls to the Range method. 140 Range []struct { 141 // Ctx is the ctx argument value. 142 Ctx context.Context 143 // In is the in argument value. 144 In *RangeReq 145 // Opts is the opts argument value. 146 Opts []grpc.CallOption 147 } 148 // Snapshots holds details about calls to the Snapshots method. 149 Snapshots []struct { 150 // Ctx is the ctx argument value. 151 Ctx context.Context 152 // In is the in argument value. 153 In *SnapshotsRequest 154 // Opts is the opts argument value. 155 Opts []grpc.CallOption 156 } 157 // StateChanges holds details about calls to the StateChanges method. 158 StateChanges []struct { 159 // Ctx is the ctx argument value. 160 Ctx context.Context 161 // In is the in argument value. 162 In *StateChangeRequest 163 // Opts is the opts argument value. 164 Opts []grpc.CallOption 165 } 166 // Tx holds details about calls to the Tx method. 167 Tx []struct { 168 // Ctx is the ctx argument value. 169 Ctx context.Context 170 // Opts is the opts argument value. 171 Opts []grpc.CallOption 172 } 173 // Version holds details about calls to the Version method. 174 Version []struct { 175 // Ctx is the ctx argument value. 176 Ctx context.Context 177 // In is the in argument value. 178 In *emptypb.Empty 179 // Opts is the opts argument value. 180 Opts []grpc.CallOption 181 } 182 } 183 lockDomainGet sync.RWMutex 184 lockDomainRange sync.RWMutex 185 lockHistoryGet sync.RWMutex 186 lockHistoryRange sync.RWMutex 187 lockIndexRange sync.RWMutex 188 lockRange sync.RWMutex 189 lockSnapshots sync.RWMutex 190 lockStateChanges sync.RWMutex 191 lockTx sync.RWMutex 192 lockVersion sync.RWMutex 193 } 194 195 // DomainGet calls DomainGetFunc. 196 func (mock *KVClientMock) DomainGet(ctx context.Context, in *DomainGetReq, opts ...grpc.CallOption) (*DomainGetReply, error) { 197 callInfo := struct { 198 Ctx context.Context 199 In *DomainGetReq 200 Opts []grpc.CallOption 201 }{ 202 Ctx: ctx, 203 In: in, 204 Opts: opts, 205 } 206 mock.lockDomainGet.Lock() 207 mock.calls.DomainGet = append(mock.calls.DomainGet, callInfo) 208 mock.lockDomainGet.Unlock() 209 if mock.DomainGetFunc == nil { 210 var ( 211 domainGetReplyOut *DomainGetReply 212 errOut error 213 ) 214 return domainGetReplyOut, errOut 215 } 216 return mock.DomainGetFunc(ctx, in, opts...) 217 } 218 219 // DomainGetCalls gets all the calls that were made to DomainGet. 220 // Check the length with: 221 // 222 // len(mockedKVClient.DomainGetCalls()) 223 func (mock *KVClientMock) DomainGetCalls() []struct { 224 Ctx context.Context 225 In *DomainGetReq 226 Opts []grpc.CallOption 227 } { 228 var calls []struct { 229 Ctx context.Context 230 In *DomainGetReq 231 Opts []grpc.CallOption 232 } 233 mock.lockDomainGet.RLock() 234 calls = mock.calls.DomainGet 235 mock.lockDomainGet.RUnlock() 236 return calls 237 } 238 239 // DomainRange calls DomainRangeFunc. 240 func (mock *KVClientMock) DomainRange(ctx context.Context, in *DomainRangeReq, opts ...grpc.CallOption) (*Pairs, error) { 241 callInfo := struct { 242 Ctx context.Context 243 In *DomainRangeReq 244 Opts []grpc.CallOption 245 }{ 246 Ctx: ctx, 247 In: in, 248 Opts: opts, 249 } 250 mock.lockDomainRange.Lock() 251 mock.calls.DomainRange = append(mock.calls.DomainRange, callInfo) 252 mock.lockDomainRange.Unlock() 253 if mock.DomainRangeFunc == nil { 254 var ( 255 pairsOut *Pairs 256 errOut error 257 ) 258 return pairsOut, errOut 259 } 260 return mock.DomainRangeFunc(ctx, in, opts...) 261 } 262 263 // DomainRangeCalls gets all the calls that were made to DomainRange. 264 // Check the length with: 265 // 266 // len(mockedKVClient.DomainRangeCalls()) 267 func (mock *KVClientMock) DomainRangeCalls() []struct { 268 Ctx context.Context 269 In *DomainRangeReq 270 Opts []grpc.CallOption 271 } { 272 var calls []struct { 273 Ctx context.Context 274 In *DomainRangeReq 275 Opts []grpc.CallOption 276 } 277 mock.lockDomainRange.RLock() 278 calls = mock.calls.DomainRange 279 mock.lockDomainRange.RUnlock() 280 return calls 281 } 282 283 // HistoryGet calls HistoryGetFunc. 284 func (mock *KVClientMock) HistoryGet(ctx context.Context, in *HistoryGetReq, opts ...grpc.CallOption) (*HistoryGetReply, error) { 285 callInfo := struct { 286 Ctx context.Context 287 In *HistoryGetReq 288 Opts []grpc.CallOption 289 }{ 290 Ctx: ctx, 291 In: in, 292 Opts: opts, 293 } 294 mock.lockHistoryGet.Lock() 295 mock.calls.HistoryGet = append(mock.calls.HistoryGet, callInfo) 296 mock.lockHistoryGet.Unlock() 297 if mock.HistoryGetFunc == nil { 298 var ( 299 historyGetReplyOut *HistoryGetReply 300 errOut error 301 ) 302 return historyGetReplyOut, errOut 303 } 304 return mock.HistoryGetFunc(ctx, in, opts...) 305 } 306 307 // HistoryGetCalls gets all the calls that were made to HistoryGet. 308 // Check the length with: 309 // 310 // len(mockedKVClient.HistoryGetCalls()) 311 func (mock *KVClientMock) HistoryGetCalls() []struct { 312 Ctx context.Context 313 In *HistoryGetReq 314 Opts []grpc.CallOption 315 } { 316 var calls []struct { 317 Ctx context.Context 318 In *HistoryGetReq 319 Opts []grpc.CallOption 320 } 321 mock.lockHistoryGet.RLock() 322 calls = mock.calls.HistoryGet 323 mock.lockHistoryGet.RUnlock() 324 return calls 325 } 326 327 // HistoryRange calls HistoryRangeFunc. 328 func (mock *KVClientMock) HistoryRange(ctx context.Context, in *HistoryRangeReq, opts ...grpc.CallOption) (*Pairs, error) { 329 callInfo := struct { 330 Ctx context.Context 331 In *HistoryRangeReq 332 Opts []grpc.CallOption 333 }{ 334 Ctx: ctx, 335 In: in, 336 Opts: opts, 337 } 338 mock.lockHistoryRange.Lock() 339 mock.calls.HistoryRange = append(mock.calls.HistoryRange, callInfo) 340 mock.lockHistoryRange.Unlock() 341 if mock.HistoryRangeFunc == nil { 342 var ( 343 pairsOut *Pairs 344 errOut error 345 ) 346 return pairsOut, errOut 347 } 348 return mock.HistoryRangeFunc(ctx, in, opts...) 349 } 350 351 // HistoryRangeCalls gets all the calls that were made to HistoryRange. 352 // Check the length with: 353 // 354 // len(mockedKVClient.HistoryRangeCalls()) 355 func (mock *KVClientMock) HistoryRangeCalls() []struct { 356 Ctx context.Context 357 In *HistoryRangeReq 358 Opts []grpc.CallOption 359 } { 360 var calls []struct { 361 Ctx context.Context 362 In *HistoryRangeReq 363 Opts []grpc.CallOption 364 } 365 mock.lockHistoryRange.RLock() 366 calls = mock.calls.HistoryRange 367 mock.lockHistoryRange.RUnlock() 368 return calls 369 } 370 371 // IndexRange calls IndexRangeFunc. 372 func (mock *KVClientMock) IndexRange(ctx context.Context, in *IndexRangeReq, opts ...grpc.CallOption) (*IndexRangeReply, error) { 373 callInfo := struct { 374 Ctx context.Context 375 In *IndexRangeReq 376 Opts []grpc.CallOption 377 }{ 378 Ctx: ctx, 379 In: in, 380 Opts: opts, 381 } 382 mock.lockIndexRange.Lock() 383 mock.calls.IndexRange = append(mock.calls.IndexRange, callInfo) 384 mock.lockIndexRange.Unlock() 385 if mock.IndexRangeFunc == nil { 386 var ( 387 indexRangeReplyOut *IndexRangeReply 388 errOut error 389 ) 390 return indexRangeReplyOut, errOut 391 } 392 return mock.IndexRangeFunc(ctx, in, opts...) 393 } 394 395 // IndexRangeCalls gets all the calls that were made to IndexRange. 396 // Check the length with: 397 // 398 // len(mockedKVClient.IndexRangeCalls()) 399 func (mock *KVClientMock) IndexRangeCalls() []struct { 400 Ctx context.Context 401 In *IndexRangeReq 402 Opts []grpc.CallOption 403 } { 404 var calls []struct { 405 Ctx context.Context 406 In *IndexRangeReq 407 Opts []grpc.CallOption 408 } 409 mock.lockIndexRange.RLock() 410 calls = mock.calls.IndexRange 411 mock.lockIndexRange.RUnlock() 412 return calls 413 } 414 415 // Range calls RangeFunc. 416 func (mock *KVClientMock) Range(ctx context.Context, in *RangeReq, opts ...grpc.CallOption) (*Pairs, error) { 417 callInfo := struct { 418 Ctx context.Context 419 In *RangeReq 420 Opts []grpc.CallOption 421 }{ 422 Ctx: ctx, 423 In: in, 424 Opts: opts, 425 } 426 mock.lockRange.Lock() 427 mock.calls.Range = append(mock.calls.Range, callInfo) 428 mock.lockRange.Unlock() 429 if mock.RangeFunc == nil { 430 var ( 431 pairsOut *Pairs 432 errOut error 433 ) 434 return pairsOut, errOut 435 } 436 return mock.RangeFunc(ctx, in, opts...) 437 } 438 439 // RangeCalls gets all the calls that were made to Range. 440 // Check the length with: 441 // 442 // len(mockedKVClient.RangeCalls()) 443 func (mock *KVClientMock) RangeCalls() []struct { 444 Ctx context.Context 445 In *RangeReq 446 Opts []grpc.CallOption 447 } { 448 var calls []struct { 449 Ctx context.Context 450 In *RangeReq 451 Opts []grpc.CallOption 452 } 453 mock.lockRange.RLock() 454 calls = mock.calls.Range 455 mock.lockRange.RUnlock() 456 return calls 457 } 458 459 // Snapshots calls SnapshotsFunc. 460 func (mock *KVClientMock) Snapshots(ctx context.Context, in *SnapshotsRequest, opts ...grpc.CallOption) (*SnapshotsReply, error) { 461 callInfo := struct { 462 Ctx context.Context 463 In *SnapshotsRequest 464 Opts []grpc.CallOption 465 }{ 466 Ctx: ctx, 467 In: in, 468 Opts: opts, 469 } 470 mock.lockSnapshots.Lock() 471 mock.calls.Snapshots = append(mock.calls.Snapshots, callInfo) 472 mock.lockSnapshots.Unlock() 473 if mock.SnapshotsFunc == nil { 474 var ( 475 snapshotsReplyOut *SnapshotsReply 476 errOut error 477 ) 478 return snapshotsReplyOut, errOut 479 } 480 return mock.SnapshotsFunc(ctx, in, opts...) 481 } 482 483 // SnapshotsCalls gets all the calls that were made to Snapshots. 484 // Check the length with: 485 // 486 // len(mockedKVClient.SnapshotsCalls()) 487 func (mock *KVClientMock) SnapshotsCalls() []struct { 488 Ctx context.Context 489 In *SnapshotsRequest 490 Opts []grpc.CallOption 491 } { 492 var calls []struct { 493 Ctx context.Context 494 In *SnapshotsRequest 495 Opts []grpc.CallOption 496 } 497 mock.lockSnapshots.RLock() 498 calls = mock.calls.Snapshots 499 mock.lockSnapshots.RUnlock() 500 return calls 501 } 502 503 // StateChanges calls StateChangesFunc. 504 func (mock *KVClientMock) StateChanges(ctx context.Context, in *StateChangeRequest, opts ...grpc.CallOption) (KV_StateChangesClient, error) { 505 callInfo := struct { 506 Ctx context.Context 507 In *StateChangeRequest 508 Opts []grpc.CallOption 509 }{ 510 Ctx: ctx, 511 In: in, 512 Opts: opts, 513 } 514 mock.lockStateChanges.Lock() 515 mock.calls.StateChanges = append(mock.calls.StateChanges, callInfo) 516 mock.lockStateChanges.Unlock() 517 if mock.StateChangesFunc == nil { 518 var ( 519 kV_StateChangesClientOut KV_StateChangesClient 520 errOut error 521 ) 522 return kV_StateChangesClientOut, errOut 523 } 524 return mock.StateChangesFunc(ctx, in, opts...) 525 } 526 527 // StateChangesCalls gets all the calls that were made to StateChanges. 528 // Check the length with: 529 // 530 // len(mockedKVClient.StateChangesCalls()) 531 func (mock *KVClientMock) StateChangesCalls() []struct { 532 Ctx context.Context 533 In *StateChangeRequest 534 Opts []grpc.CallOption 535 } { 536 var calls []struct { 537 Ctx context.Context 538 In *StateChangeRequest 539 Opts []grpc.CallOption 540 } 541 mock.lockStateChanges.RLock() 542 calls = mock.calls.StateChanges 543 mock.lockStateChanges.RUnlock() 544 return calls 545 } 546 547 // Tx calls TxFunc. 548 func (mock *KVClientMock) Tx(ctx context.Context, opts ...grpc.CallOption) (KV_TxClient, error) { 549 callInfo := struct { 550 Ctx context.Context 551 Opts []grpc.CallOption 552 }{ 553 Ctx: ctx, 554 Opts: opts, 555 } 556 mock.lockTx.Lock() 557 mock.calls.Tx = append(mock.calls.Tx, callInfo) 558 mock.lockTx.Unlock() 559 if mock.TxFunc == nil { 560 var ( 561 kV_TxClientOut KV_TxClient 562 errOut error 563 ) 564 return kV_TxClientOut, errOut 565 } 566 return mock.TxFunc(ctx, opts...) 567 } 568 569 // TxCalls gets all the calls that were made to Tx. 570 // Check the length with: 571 // 572 // len(mockedKVClient.TxCalls()) 573 func (mock *KVClientMock) TxCalls() []struct { 574 Ctx context.Context 575 Opts []grpc.CallOption 576 } { 577 var calls []struct { 578 Ctx context.Context 579 Opts []grpc.CallOption 580 } 581 mock.lockTx.RLock() 582 calls = mock.calls.Tx 583 mock.lockTx.RUnlock() 584 return calls 585 } 586 587 // Version calls VersionFunc. 588 func (mock *KVClientMock) Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*types.VersionReply, error) { 589 callInfo := struct { 590 Ctx context.Context 591 In *emptypb.Empty 592 Opts []grpc.CallOption 593 }{ 594 Ctx: ctx, 595 In: in, 596 Opts: opts, 597 } 598 mock.lockVersion.Lock() 599 mock.calls.Version = append(mock.calls.Version, callInfo) 600 mock.lockVersion.Unlock() 601 if mock.VersionFunc == nil { 602 var ( 603 versionReplyOut *types.VersionReply 604 errOut error 605 ) 606 return versionReplyOut, errOut 607 } 608 return mock.VersionFunc(ctx, in, opts...) 609 } 610 611 // VersionCalls gets all the calls that were made to Version. 612 // Check the length with: 613 // 614 // len(mockedKVClient.VersionCalls()) 615 func (mock *KVClientMock) VersionCalls() []struct { 616 Ctx context.Context 617 In *emptypb.Empty 618 Opts []grpc.CallOption 619 } { 620 var calls []struct { 621 Ctx context.Context 622 In *emptypb.Empty 623 Opts []grpc.CallOption 624 } 625 mock.lockVersion.RLock() 626 calls = mock.calls.Version 627 mock.lockVersion.RUnlock() 628 return calls 629 } 630 631 // Ensure, that KV_StateChangesClientMock does implement KV_StateChangesClient. 632 // If this is not the case, regenerate this file with moq. 633 var _ KV_StateChangesClient = &KV_StateChangesClientMock{} 634 635 // KV_StateChangesClientMock is a mock implementation of KV_StateChangesClient. 636 // 637 // func TestSomethingThatUsesKV_StateChangesClient(t *testing.T) { 638 // 639 // // make and configure a mocked KV_StateChangesClient 640 // mockedKV_StateChangesClient := &KV_StateChangesClientMock{ 641 // CloseSendFunc: func() error { 642 // panic("mock out the CloseSend method") 643 // }, 644 // ContextFunc: func() context.Context { 645 // panic("mock out the Context method") 646 // }, 647 // HeaderFunc: func() (metadata.MD, error) { 648 // panic("mock out the Header method") 649 // }, 650 // RecvFunc: func() (*StateChangeBatch, error) { 651 // panic("mock out the Recv method") 652 // }, 653 // RecvMsgFunc: func(m any) error { 654 // panic("mock out the RecvMsg method") 655 // }, 656 // SendMsgFunc: func(m any) error { 657 // panic("mock out the SendMsg method") 658 // }, 659 // TrailerFunc: func() metadata.MD { 660 // panic("mock out the Trailer method") 661 // }, 662 // } 663 // 664 // // use mockedKV_StateChangesClient in code that requires KV_StateChangesClient 665 // // and then make assertions. 666 // 667 // } 668 type KV_StateChangesClientMock struct { 669 // CloseSendFunc mocks the CloseSend method. 670 CloseSendFunc func() error 671 672 // ContextFunc mocks the Context method. 673 ContextFunc func() context.Context 674 675 // HeaderFunc mocks the Header method. 676 HeaderFunc func() (metadata.MD, error) 677 678 // RecvFunc mocks the Recv method. 679 RecvFunc func() (*StateChangeBatch, error) 680 681 // RecvMsgFunc mocks the RecvMsg method. 682 RecvMsgFunc func(m any) error 683 684 // SendMsgFunc mocks the SendMsg method. 685 SendMsgFunc func(m any) error 686 687 // TrailerFunc mocks the Trailer method. 688 TrailerFunc func() metadata.MD 689 690 // calls tracks calls to the methods. 691 calls struct { 692 // CloseSend holds details about calls to the CloseSend method. 693 CloseSend []struct { 694 } 695 // Context holds details about calls to the Context method. 696 Context []struct { 697 } 698 // Header holds details about calls to the Header method. 699 Header []struct { 700 } 701 // Recv holds details about calls to the Recv method. 702 Recv []struct { 703 } 704 // RecvMsg holds details about calls to the RecvMsg method. 705 RecvMsg []struct { 706 // M is the m argument value. 707 M any 708 } 709 // SendMsg holds details about calls to the SendMsg method. 710 SendMsg []struct { 711 // M is the m argument value. 712 M any 713 } 714 // Trailer holds details about calls to the Trailer method. 715 Trailer []struct { 716 } 717 } 718 lockCloseSend sync.RWMutex 719 lockContext sync.RWMutex 720 lockHeader sync.RWMutex 721 lockRecv sync.RWMutex 722 lockRecvMsg sync.RWMutex 723 lockSendMsg sync.RWMutex 724 lockTrailer sync.RWMutex 725 } 726 727 // CloseSend calls CloseSendFunc. 728 func (mock *KV_StateChangesClientMock) CloseSend() error { 729 callInfo := struct { 730 }{} 731 mock.lockCloseSend.Lock() 732 mock.calls.CloseSend = append(mock.calls.CloseSend, callInfo) 733 mock.lockCloseSend.Unlock() 734 if mock.CloseSendFunc == nil { 735 var ( 736 errOut error 737 ) 738 return errOut 739 } 740 return mock.CloseSendFunc() 741 } 742 743 // CloseSendCalls gets all the calls that were made to CloseSend. 744 // Check the length with: 745 // 746 // len(mockedKV_StateChangesClient.CloseSendCalls()) 747 func (mock *KV_StateChangesClientMock) CloseSendCalls() []struct { 748 } { 749 var calls []struct { 750 } 751 mock.lockCloseSend.RLock() 752 calls = mock.calls.CloseSend 753 mock.lockCloseSend.RUnlock() 754 return calls 755 } 756 757 // Context calls ContextFunc. 758 func (mock *KV_StateChangesClientMock) Context() context.Context { 759 callInfo := struct { 760 }{} 761 mock.lockContext.Lock() 762 mock.calls.Context = append(mock.calls.Context, callInfo) 763 mock.lockContext.Unlock() 764 if mock.ContextFunc == nil { 765 var ( 766 contextOut context.Context 767 ) 768 return contextOut 769 } 770 return mock.ContextFunc() 771 } 772 773 // ContextCalls gets all the calls that were made to Context. 774 // Check the length with: 775 // 776 // len(mockedKV_StateChangesClient.ContextCalls()) 777 func (mock *KV_StateChangesClientMock) ContextCalls() []struct { 778 } { 779 var calls []struct { 780 } 781 mock.lockContext.RLock() 782 calls = mock.calls.Context 783 mock.lockContext.RUnlock() 784 return calls 785 } 786 787 // Header calls HeaderFunc. 788 func (mock *KV_StateChangesClientMock) Header() (metadata.MD, error) { 789 callInfo := struct { 790 }{} 791 mock.lockHeader.Lock() 792 mock.calls.Header = append(mock.calls.Header, callInfo) 793 mock.lockHeader.Unlock() 794 if mock.HeaderFunc == nil { 795 var ( 796 mDOut metadata.MD 797 errOut error 798 ) 799 return mDOut, errOut 800 } 801 return mock.HeaderFunc() 802 } 803 804 // HeaderCalls gets all the calls that were made to Header. 805 // Check the length with: 806 // 807 // len(mockedKV_StateChangesClient.HeaderCalls()) 808 func (mock *KV_StateChangesClientMock) HeaderCalls() []struct { 809 } { 810 var calls []struct { 811 } 812 mock.lockHeader.RLock() 813 calls = mock.calls.Header 814 mock.lockHeader.RUnlock() 815 return calls 816 } 817 818 // Recv calls RecvFunc. 819 func (mock *KV_StateChangesClientMock) Recv() (*StateChangeBatch, error) { 820 callInfo := struct { 821 }{} 822 mock.lockRecv.Lock() 823 mock.calls.Recv = append(mock.calls.Recv, callInfo) 824 mock.lockRecv.Unlock() 825 if mock.RecvFunc == nil { 826 var ( 827 stateChangeBatchOut *StateChangeBatch 828 errOut error 829 ) 830 return stateChangeBatchOut, errOut 831 } 832 return mock.RecvFunc() 833 } 834 835 // RecvCalls gets all the calls that were made to Recv. 836 // Check the length with: 837 // 838 // len(mockedKV_StateChangesClient.RecvCalls()) 839 func (mock *KV_StateChangesClientMock) RecvCalls() []struct { 840 } { 841 var calls []struct { 842 } 843 mock.lockRecv.RLock() 844 calls = mock.calls.Recv 845 mock.lockRecv.RUnlock() 846 return calls 847 } 848 849 // RecvMsg calls RecvMsgFunc. 850 func (mock *KV_StateChangesClientMock) RecvMsg(m any) error { 851 callInfo := struct { 852 M any 853 }{ 854 M: m, 855 } 856 mock.lockRecvMsg.Lock() 857 mock.calls.RecvMsg = append(mock.calls.RecvMsg, callInfo) 858 mock.lockRecvMsg.Unlock() 859 if mock.RecvMsgFunc == nil { 860 var ( 861 errOut error 862 ) 863 return errOut 864 } 865 return mock.RecvMsgFunc(m) 866 } 867 868 // RecvMsgCalls gets all the calls that were made to RecvMsg. 869 // Check the length with: 870 // 871 // len(mockedKV_StateChangesClient.RecvMsgCalls()) 872 func (mock *KV_StateChangesClientMock) RecvMsgCalls() []struct { 873 M any 874 } { 875 var calls []struct { 876 M any 877 } 878 mock.lockRecvMsg.RLock() 879 calls = mock.calls.RecvMsg 880 mock.lockRecvMsg.RUnlock() 881 return calls 882 } 883 884 // SendMsg calls SendMsgFunc. 885 func (mock *KV_StateChangesClientMock) SendMsg(m any) error { 886 callInfo := struct { 887 M any 888 }{ 889 M: m, 890 } 891 mock.lockSendMsg.Lock() 892 mock.calls.SendMsg = append(mock.calls.SendMsg, callInfo) 893 mock.lockSendMsg.Unlock() 894 if mock.SendMsgFunc == nil { 895 var ( 896 errOut error 897 ) 898 return errOut 899 } 900 return mock.SendMsgFunc(m) 901 } 902 903 // SendMsgCalls gets all the calls that were made to SendMsg. 904 // Check the length with: 905 // 906 // len(mockedKV_StateChangesClient.SendMsgCalls()) 907 func (mock *KV_StateChangesClientMock) SendMsgCalls() []struct { 908 M any 909 } { 910 var calls []struct { 911 M any 912 } 913 mock.lockSendMsg.RLock() 914 calls = mock.calls.SendMsg 915 mock.lockSendMsg.RUnlock() 916 return calls 917 } 918 919 // Trailer calls TrailerFunc. 920 func (mock *KV_StateChangesClientMock) Trailer() metadata.MD { 921 callInfo := struct { 922 }{} 923 mock.lockTrailer.Lock() 924 mock.calls.Trailer = append(mock.calls.Trailer, callInfo) 925 mock.lockTrailer.Unlock() 926 if mock.TrailerFunc == nil { 927 var ( 928 mDOut metadata.MD 929 ) 930 return mDOut 931 } 932 return mock.TrailerFunc() 933 } 934 935 // TrailerCalls gets all the calls that were made to Trailer. 936 // Check the length with: 937 // 938 // len(mockedKV_StateChangesClient.TrailerCalls()) 939 func (mock *KV_StateChangesClientMock) TrailerCalls() []struct { 940 } { 941 var calls []struct { 942 } 943 mock.lockTrailer.RLock() 944 calls = mock.calls.Trailer 945 mock.lockTrailer.RUnlock() 946 return calls 947 }