github.com/m3db/m3@v1.5.1-0.20231129193456-75a402aa583b/src/dbnode/storage/limits/permits/permits_mock.go (about) 1 // Code generated by MockGen. DO NOT EDIT. 2 // Source: ../../storage/limits/permits/types.go 3 4 // Copyright (c) 2022 Uber Technologies, Inc. 5 // 6 // Permission is hereby granted, free of charge, to any person obtaining a copy 7 // of this software and associated documentation files (the "Software"), to deal 8 // in the Software without restriction, including without limitation the rights 9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 // copies of the Software, and to permit persons to whom the Software is 11 // furnished to do so, subject to the following conditions: 12 // 13 // The above copyright notice and this permission notice shall be included in 14 // all copies or substantial portions of the Software. 15 // 16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 // THE SOFTWARE. 23 24 // Package permits is a generated GoMock package. 25 package permits 26 27 import ( 28 "reflect" 29 30 "github.com/m3db/m3/src/x/context" 31 32 "github.com/golang/mock/gomock" 33 ) 34 35 // MockOptions is a mock of Options interface. 36 type MockOptions struct { 37 ctrl *gomock.Controller 38 recorder *MockOptionsMockRecorder 39 } 40 41 // MockOptionsMockRecorder is the mock recorder for MockOptions. 42 type MockOptionsMockRecorder struct { 43 mock *MockOptions 44 } 45 46 // NewMockOptions creates a new mock instance. 47 func NewMockOptions(ctrl *gomock.Controller) *MockOptions { 48 mock := &MockOptions{ctrl: ctrl} 49 mock.recorder = &MockOptionsMockRecorder{mock} 50 return mock 51 } 52 53 // EXPECT returns an object that allows the caller to indicate expected use. 54 func (m *MockOptions) EXPECT() *MockOptionsMockRecorder { 55 return m.recorder 56 } 57 58 // IndexQueryPermitsManager mocks base method. 59 func (m *MockOptions) IndexQueryPermitsManager() Manager { 60 m.ctrl.T.Helper() 61 ret := m.ctrl.Call(m, "IndexQueryPermitsManager") 62 ret0, _ := ret[0].(Manager) 63 return ret0 64 } 65 66 // IndexQueryPermitsManager indicates an expected call of IndexQueryPermitsManager. 67 func (mr *MockOptionsMockRecorder) IndexQueryPermitsManager() *gomock.Call { 68 mr.mock.ctrl.T.Helper() 69 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IndexQueryPermitsManager", reflect.TypeOf((*MockOptions)(nil).IndexQueryPermitsManager)) 70 } 71 72 // SeriesReadPermitsManager mocks base method. 73 func (m *MockOptions) SeriesReadPermitsManager() Manager { 74 m.ctrl.T.Helper() 75 ret := m.ctrl.Call(m, "SeriesReadPermitsManager") 76 ret0, _ := ret[0].(Manager) 77 return ret0 78 } 79 80 // SeriesReadPermitsManager indicates an expected call of SeriesReadPermitsManager. 81 func (mr *MockOptionsMockRecorder) SeriesReadPermitsManager() *gomock.Call { 82 mr.mock.ctrl.T.Helper() 83 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SeriesReadPermitsManager", reflect.TypeOf((*MockOptions)(nil).SeriesReadPermitsManager)) 84 } 85 86 // SetIndexQueryPermitsManager mocks base method. 87 func (m *MockOptions) SetIndexQueryPermitsManager(manager Manager) Options { 88 m.ctrl.T.Helper() 89 ret := m.ctrl.Call(m, "SetIndexQueryPermitsManager", manager) 90 ret0, _ := ret[0].(Options) 91 return ret0 92 } 93 94 // SetIndexQueryPermitsManager indicates an expected call of SetIndexQueryPermitsManager. 95 func (mr *MockOptionsMockRecorder) SetIndexQueryPermitsManager(manager interface{}) *gomock.Call { 96 mr.mock.ctrl.T.Helper() 97 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetIndexQueryPermitsManager", reflect.TypeOf((*MockOptions)(nil).SetIndexQueryPermitsManager), manager) 98 } 99 100 // SetSeriesReadPermitsManager mocks base method. 101 func (m *MockOptions) SetSeriesReadPermitsManager(manager Manager) Options { 102 m.ctrl.T.Helper() 103 ret := m.ctrl.Call(m, "SetSeriesReadPermitsManager", manager) 104 ret0, _ := ret[0].(Options) 105 return ret0 106 } 107 108 // SetSeriesReadPermitsManager indicates an expected call of SetSeriesReadPermitsManager. 109 func (mr *MockOptionsMockRecorder) SetSeriesReadPermitsManager(manager interface{}) *gomock.Call { 110 mr.mock.ctrl.T.Helper() 111 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSeriesReadPermitsManager", reflect.TypeOf((*MockOptions)(nil).SetSeriesReadPermitsManager), manager) 112 } 113 114 // MockManager is a mock of Manager interface. 115 type MockManager struct { 116 ctrl *gomock.Controller 117 recorder *MockManagerMockRecorder 118 } 119 120 // MockManagerMockRecorder is the mock recorder for MockManager. 121 type MockManagerMockRecorder struct { 122 mock *MockManager 123 } 124 125 // NewMockManager creates a new mock instance. 126 func NewMockManager(ctrl *gomock.Controller) *MockManager { 127 mock := &MockManager{ctrl: ctrl} 128 mock.recorder = &MockManagerMockRecorder{mock} 129 return mock 130 } 131 132 // EXPECT returns an object that allows the caller to indicate expected use. 133 func (m *MockManager) EXPECT() *MockManagerMockRecorder { 134 return m.recorder 135 } 136 137 // NewPermits mocks base method. 138 func (m *MockManager) NewPermits(ctx context.Context) (Permits, error) { 139 m.ctrl.T.Helper() 140 ret := m.ctrl.Call(m, "NewPermits", ctx) 141 ret0, _ := ret[0].(Permits) 142 ret1, _ := ret[1].(error) 143 return ret0, ret1 144 } 145 146 // NewPermits indicates an expected call of NewPermits. 147 func (mr *MockManagerMockRecorder) NewPermits(ctx interface{}) *gomock.Call { 148 mr.mock.ctrl.T.Helper() 149 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewPermits", reflect.TypeOf((*MockManager)(nil).NewPermits), ctx) 150 } 151 152 // MockPermits is a mock of Permits interface. 153 type MockPermits struct { 154 ctrl *gomock.Controller 155 recorder *MockPermitsMockRecorder 156 } 157 158 // MockPermitsMockRecorder is the mock recorder for MockPermits. 159 type MockPermitsMockRecorder struct { 160 mock *MockPermits 161 } 162 163 // NewMockPermits creates a new mock instance. 164 func NewMockPermits(ctrl *gomock.Controller) *MockPermits { 165 mock := &MockPermits{ctrl: ctrl} 166 mock.recorder = &MockPermitsMockRecorder{mock} 167 return mock 168 } 169 170 // EXPECT returns an object that allows the caller to indicate expected use. 171 func (m *MockPermits) EXPECT() *MockPermitsMockRecorder { 172 return m.recorder 173 } 174 175 // Acquire mocks base method. 176 func (m *MockPermits) Acquire(ctx context.Context) (AcquireResult, error) { 177 m.ctrl.T.Helper() 178 ret := m.ctrl.Call(m, "Acquire", ctx) 179 ret0, _ := ret[0].(AcquireResult) 180 ret1, _ := ret[1].(error) 181 return ret0, ret1 182 } 183 184 // Acquire indicates an expected call of Acquire. 185 func (mr *MockPermitsMockRecorder) Acquire(ctx interface{}) *gomock.Call { 186 mr.mock.ctrl.T.Helper() 187 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Acquire", reflect.TypeOf((*MockPermits)(nil).Acquire), ctx) 188 } 189 190 // Close mocks base method. 191 func (m *MockPermits) Close() { 192 m.ctrl.T.Helper() 193 m.ctrl.Call(m, "Close") 194 } 195 196 // Close indicates an expected call of Close. 197 func (mr *MockPermitsMockRecorder) Close() *gomock.Call { 198 mr.mock.ctrl.T.Helper() 199 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockPermits)(nil).Close)) 200 } 201 202 // Release mocks base method. 203 func (m *MockPermits) Release(permit Permit) { 204 m.ctrl.T.Helper() 205 m.ctrl.Call(m, "Release", permit) 206 } 207 208 // Release indicates an expected call of Release. 209 func (mr *MockPermitsMockRecorder) Release(permit interface{}) *gomock.Call { 210 mr.mock.ctrl.T.Helper() 211 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Release", reflect.TypeOf((*MockPermits)(nil).Release), permit) 212 } 213 214 // TryAcquire mocks base method. 215 func (m *MockPermits) TryAcquire(ctx context.Context) (Permit, error) { 216 m.ctrl.T.Helper() 217 ret := m.ctrl.Call(m, "TryAcquire", ctx) 218 ret0, _ := ret[0].(Permit) 219 ret1, _ := ret[1].(error) 220 return ret0, ret1 221 } 222 223 // TryAcquire indicates an expected call of TryAcquire. 224 func (mr *MockPermitsMockRecorder) TryAcquire(ctx interface{}) *gomock.Call { 225 mr.mock.ctrl.T.Helper() 226 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TryAcquire", reflect.TypeOf((*MockPermits)(nil).TryAcquire), ctx) 227 } 228 229 // MockPermit is a mock of Permit interface. 230 type MockPermit struct { 231 ctrl *gomock.Controller 232 recorder *MockPermitMockRecorder 233 } 234 235 // MockPermitMockRecorder is the mock recorder for MockPermit. 236 type MockPermitMockRecorder struct { 237 mock *MockPermit 238 } 239 240 // NewMockPermit creates a new mock instance. 241 func NewMockPermit(ctrl *gomock.Controller) *MockPermit { 242 mock := &MockPermit{ctrl: ctrl} 243 mock.recorder = &MockPermitMockRecorder{mock} 244 return mock 245 } 246 247 // EXPECT returns an object that allows the caller to indicate expected use. 248 func (m *MockPermit) EXPECT() *MockPermitMockRecorder { 249 return m.recorder 250 } 251 252 // AllowedQuota mocks base method. 253 func (m *MockPermit) AllowedQuota() int64 { 254 m.ctrl.T.Helper() 255 ret := m.ctrl.Call(m, "AllowedQuota") 256 ret0, _ := ret[0].(int64) 257 return ret0 258 } 259 260 // AllowedQuota indicates an expected call of AllowedQuota. 261 func (mr *MockPermitMockRecorder) AllowedQuota() *gomock.Call { 262 mr.mock.ctrl.T.Helper() 263 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllowedQuota", reflect.TypeOf((*MockPermit)(nil).AllowedQuota)) 264 } 265 266 // PostRelease mocks base method. 267 func (m *MockPermit) PostRelease() { 268 m.ctrl.T.Helper() 269 m.ctrl.Call(m, "PostRelease") 270 } 271 272 // PostRelease indicates an expected call of PostRelease. 273 func (mr *MockPermitMockRecorder) PostRelease() *gomock.Call { 274 mr.mock.ctrl.T.Helper() 275 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PostRelease", reflect.TypeOf((*MockPermit)(nil).PostRelease)) 276 } 277 278 // PreAcquire mocks base method. 279 func (m *MockPermit) PreAcquire() { 280 m.ctrl.T.Helper() 281 m.ctrl.Call(m, "PreAcquire") 282 } 283 284 // PreAcquire indicates an expected call of PreAcquire. 285 func (mr *MockPermitMockRecorder) PreAcquire() *gomock.Call { 286 mr.mock.ctrl.T.Helper() 287 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PreAcquire", reflect.TypeOf((*MockPermit)(nil).PreAcquire)) 288 } 289 290 // QuotaRemaining mocks base method. 291 func (m *MockPermit) QuotaRemaining() int64 { 292 m.ctrl.T.Helper() 293 ret := m.ctrl.Call(m, "QuotaRemaining") 294 ret0, _ := ret[0].(int64) 295 return ret0 296 } 297 298 // QuotaRemaining indicates an expected call of QuotaRemaining. 299 func (mr *MockPermitMockRecorder) QuotaRemaining() *gomock.Call { 300 mr.mock.ctrl.T.Helper() 301 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QuotaRemaining", reflect.TypeOf((*MockPermit)(nil).QuotaRemaining)) 302 } 303 304 // Use mocks base method. 305 func (m *MockPermit) Use(quota int64) { 306 m.ctrl.T.Helper() 307 m.ctrl.Call(m, "Use", quota) 308 } 309 310 // Use indicates an expected call of Use. 311 func (mr *MockPermitMockRecorder) Use(quota interface{}) *gomock.Call { 312 mr.mock.ctrl.T.Helper() 313 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Use", reflect.TypeOf((*MockPermit)(nil).Use), quota) 314 }