MCPcopy
hub / github.com/rqlite/rqlite / MockStore

Struct MockStore

http/service_test.go:2533–2546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2531}
2532
2533type 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
2548func (m *MockStore) Execute(ctx context.Context, er *command.ExecuteRequest) ([]*command.ExecuteQueryResponse, uint64, error) {
2549 if m.executeFn != nil {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected