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