github.com/grafana/pyroscope@v1.18.0/pkg/test/mocks/mockindex/mock_store.go (about) 1 // Code generated by mockery. DO NOT EDIT. 2 3 package mockindex 4 5 import ( 6 bbolt "go.etcd.io/bbolt" 7 8 iter "iter" 9 10 mock "github.com/stretchr/testify/mock" 11 12 store "github.com/grafana/pyroscope/pkg/metastore/index/store" 13 ) 14 15 // MockStore is an autogenerated mock type for the Store type 16 type MockStore struct { 17 mock.Mock 18 } 19 20 type MockStore_Expecter struct { 21 mock *mock.Mock 22 } 23 24 func (_m *MockStore) EXPECT() *MockStore_Expecter { 25 return &MockStore_Expecter{mock: &_m.Mock} 26 } 27 28 // CreateBuckets provides a mock function with given fields: _a0 29 func (_m *MockStore) CreateBuckets(_a0 *bbolt.Tx) error { 30 ret := _m.Called(_a0) 31 32 if len(ret) == 0 { 33 panic("no return value specified for CreateBuckets") 34 } 35 36 var r0 error 37 if rf, ok := ret.Get(0).(func(*bbolt.Tx) error); ok { 38 r0 = rf(_a0) 39 } else { 40 r0 = ret.Error(0) 41 } 42 43 return r0 44 } 45 46 // MockStore_CreateBuckets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateBuckets' 47 type MockStore_CreateBuckets_Call struct { 48 *mock.Call 49 } 50 51 // CreateBuckets is a helper method to define mock.On call 52 // - _a0 *bbolt.Tx 53 func (_e *MockStore_Expecter) CreateBuckets(_a0 interface{}) *MockStore_CreateBuckets_Call { 54 return &MockStore_CreateBuckets_Call{Call: _e.mock.On("CreateBuckets", _a0)} 55 } 56 57 func (_c *MockStore_CreateBuckets_Call) Run(run func(_a0 *bbolt.Tx)) *MockStore_CreateBuckets_Call { 58 _c.Call.Run(func(args mock.Arguments) { 59 run(args[0].(*bbolt.Tx)) 60 }) 61 return _c 62 } 63 64 func (_c *MockStore_CreateBuckets_Call) Return(_a0 error) *MockStore_CreateBuckets_Call { 65 _c.Call.Return(_a0) 66 return _c 67 } 68 69 func (_c *MockStore_CreateBuckets_Call) RunAndReturn(run func(*bbolt.Tx) error) *MockStore_CreateBuckets_Call { 70 _c.Call.Return(run) 71 return _c 72 } 73 74 // DeleteShard provides a mock function with given fields: tx, p, tenant, shard 75 func (_m *MockStore) DeleteShard(tx *bbolt.Tx, p store.Partition, tenant string, shard uint32) error { 76 ret := _m.Called(tx, p, tenant, shard) 77 78 if len(ret) == 0 { 79 panic("no return value specified for DeleteShard") 80 } 81 82 var r0 error 83 if rf, ok := ret.Get(0).(func(*bbolt.Tx, store.Partition, string, uint32) error); ok { 84 r0 = rf(tx, p, tenant, shard) 85 } else { 86 r0 = ret.Error(0) 87 } 88 89 return r0 90 } 91 92 // MockStore_DeleteShard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteShard' 93 type MockStore_DeleteShard_Call struct { 94 *mock.Call 95 } 96 97 // DeleteShard is a helper method to define mock.On call 98 // - tx *bbolt.Tx 99 // - p store.Partition 100 // - tenant string 101 // - shard uint32 102 func (_e *MockStore_Expecter) DeleteShard(tx interface{}, p interface{}, tenant interface{}, shard interface{}) *MockStore_DeleteShard_Call { 103 return &MockStore_DeleteShard_Call{Call: _e.mock.On("DeleteShard", tx, p, tenant, shard)} 104 } 105 106 func (_c *MockStore_DeleteShard_Call) Run(run func(tx *bbolt.Tx, p store.Partition, tenant string, shard uint32)) *MockStore_DeleteShard_Call { 107 _c.Call.Run(func(args mock.Arguments) { 108 run(args[0].(*bbolt.Tx), args[1].(store.Partition), args[2].(string), args[3].(uint32)) 109 }) 110 return _c 111 } 112 113 func (_c *MockStore_DeleteShard_Call) Return(_a0 error) *MockStore_DeleteShard_Call { 114 _c.Call.Return(_a0) 115 return _c 116 } 117 118 func (_c *MockStore_DeleteShard_Call) RunAndReturn(run func(*bbolt.Tx, store.Partition, string, uint32) error) *MockStore_DeleteShard_Call { 119 _c.Call.Return(run) 120 return _c 121 } 122 123 // LoadShard provides a mock function with given fields: tx, p, tenant, shard 124 func (_m *MockStore) LoadShard(tx *bbolt.Tx, p store.Partition, tenant string, shard uint32) (*store.Shard, error) { 125 ret := _m.Called(tx, p, tenant, shard) 126 127 if len(ret) == 0 { 128 panic("no return value specified for LoadShard") 129 } 130 131 var r0 *store.Shard 132 var r1 error 133 if rf, ok := ret.Get(0).(func(*bbolt.Tx, store.Partition, string, uint32) (*store.Shard, error)); ok { 134 return rf(tx, p, tenant, shard) 135 } 136 if rf, ok := ret.Get(0).(func(*bbolt.Tx, store.Partition, string, uint32) *store.Shard); ok { 137 r0 = rf(tx, p, tenant, shard) 138 } else { 139 if ret.Get(0) != nil { 140 r0 = ret.Get(0).(*store.Shard) 141 } 142 } 143 144 if rf, ok := ret.Get(1).(func(*bbolt.Tx, store.Partition, string, uint32) error); ok { 145 r1 = rf(tx, p, tenant, shard) 146 } else { 147 r1 = ret.Error(1) 148 } 149 150 return r0, r1 151 } 152 153 // MockStore_LoadShard_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadShard' 154 type MockStore_LoadShard_Call struct { 155 *mock.Call 156 } 157 158 // LoadShard is a helper method to define mock.On call 159 // - tx *bbolt.Tx 160 // - p store.Partition 161 // - tenant string 162 // - shard uint32 163 func (_e *MockStore_Expecter) LoadShard(tx interface{}, p interface{}, tenant interface{}, shard interface{}) *MockStore_LoadShard_Call { 164 return &MockStore_LoadShard_Call{Call: _e.mock.On("LoadShard", tx, p, tenant, shard)} 165 } 166 167 func (_c *MockStore_LoadShard_Call) Run(run func(tx *bbolt.Tx, p store.Partition, tenant string, shard uint32)) *MockStore_LoadShard_Call { 168 _c.Call.Run(func(args mock.Arguments) { 169 run(args[0].(*bbolt.Tx), args[1].(store.Partition), args[2].(string), args[3].(uint32)) 170 }) 171 return _c 172 } 173 174 func (_c *MockStore_LoadShard_Call) Return(_a0 *store.Shard, _a1 error) *MockStore_LoadShard_Call { 175 _c.Call.Return(_a0, _a1) 176 return _c 177 } 178 179 func (_c *MockStore_LoadShard_Call) RunAndReturn(run func(*bbolt.Tx, store.Partition, string, uint32) (*store.Shard, error)) *MockStore_LoadShard_Call { 180 _c.Call.Return(run) 181 return _c 182 } 183 184 // Partitions provides a mock function with given fields: tx 185 func (_m *MockStore) Partitions(tx *bbolt.Tx) iter.Seq[store.Partition] { 186 ret := _m.Called(tx) 187 188 if len(ret) == 0 { 189 panic("no return value specified for Partitions") 190 } 191 192 var r0 iter.Seq[store.Partition] 193 if rf, ok := ret.Get(0).(func(*bbolt.Tx) iter.Seq[store.Partition]); ok { 194 r0 = rf(tx) 195 } else { 196 if ret.Get(0) != nil { 197 r0 = ret.Get(0).(iter.Seq[store.Partition]) 198 } 199 } 200 201 return r0 202 } 203 204 // MockStore_Partitions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Partitions' 205 type MockStore_Partitions_Call struct { 206 *mock.Call 207 } 208 209 // Partitions is a helper method to define mock.On call 210 // - tx *bbolt.Tx 211 func (_e *MockStore_Expecter) Partitions(tx interface{}) *MockStore_Partitions_Call { 212 return &MockStore_Partitions_Call{Call: _e.mock.On("Partitions", tx)} 213 } 214 215 func (_c *MockStore_Partitions_Call) Run(run func(tx *bbolt.Tx)) *MockStore_Partitions_Call { 216 _c.Call.Run(func(args mock.Arguments) { 217 run(args[0].(*bbolt.Tx)) 218 }) 219 return _c 220 } 221 222 func (_c *MockStore_Partitions_Call) Return(_a0 iter.Seq[store.Partition]) *MockStore_Partitions_Call { 223 _c.Call.Return(_a0) 224 return _c 225 } 226 227 func (_c *MockStore_Partitions_Call) RunAndReturn(run func(*bbolt.Tx) iter.Seq[store.Partition]) *MockStore_Partitions_Call { 228 _c.Call.Return(run) 229 return _c 230 } 231 232 // NewMockStore creates a new instance of MockStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 233 // The first argument is typically a *testing.T value. 234 func NewMockStore(t interface { 235 mock.TestingT 236 Cleanup(func()) 237 }) *MockStore { 238 mock := &MockStore{} 239 mock.Mock.Test(t) 240 241 t.Cleanup(func() { mock.AssertExpectations(t) }) 242 243 return mock 244 }