| 2531 | } |
| 2532 | |
| 2533 | type MockStore struct { |
| 2534 | executeFn func(er *command.ExecuteRequest) ([]*command.ExecuteQueryResponse, uint64, error) |
| 2535 | queryFn func(qr *command.QueryRequest) ([]*command.QueryRows, uint64, error) |
| 2536 | requestFn func(eqr *command.ExecuteQueryRequest) ([]*command.ExecuteQueryResponse, uint64, uint64, error) |
| 2537 | backupFn func(br *command.BackupRequest, dst io.Writer) error |
| 2538 | loadFn func(lr *command.LoadRequest) error |
| 2539 | snapshotFn func(n uint64) error |
| 2540 | reapFn func() (int, int, error) |
| 2541 | readFromFn func(r io.Reader) (int64, error) |
| 2542 | committedFn func(timeout time.Duration) (uint64, error) |
| 2543 | stepdownFn func(wait bool, id string) error |
| 2544 | leaderAddr string |
| 2545 | notReady bool // Default value is true, easier to test. |
| 2546 | } |
| 2547 | |
| 2548 | func (m *MockStore) Execute(ctx context.Context, er *command.ExecuteRequest) ([]*command.ExecuteQueryResponse, uint64, error) { |
| 2549 | if m.executeFn != nil { |
nothing calls this directly
no outgoing calls
no test coverage detected