github.com/projecteru2/core@v0.0.0-20240321043226-06bcc1c23f58/cluster/mocks/Cluster.go (about) 1 // Code generated by mockery v2.33.2. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 enginetypes "github.com/projecteru2/core/engine/types" 9 mock "github.com/stretchr/testify/mock" 10 11 types "github.com/projecteru2/core/types" 12 ) 13 14 // Cluster is an autogenerated mock type for the Cluster type 15 type Cluster struct { 16 mock.Mock 17 } 18 19 // AddNode provides a mock function with given fields: _a0, _a1 20 func (_m *Cluster) AddNode(_a0 context.Context, _a1 *types.AddNodeOptions) (*types.Node, error) { 21 ret := _m.Called(_a0, _a1) 22 23 var r0 *types.Node 24 var r1 error 25 if rf, ok := ret.Get(0).(func(context.Context, *types.AddNodeOptions) (*types.Node, error)); ok { 26 return rf(_a0, _a1) 27 } 28 if rf, ok := ret.Get(0).(func(context.Context, *types.AddNodeOptions) *types.Node); ok { 29 r0 = rf(_a0, _a1) 30 } else { 31 if ret.Get(0) != nil { 32 r0 = ret.Get(0).(*types.Node) 33 } 34 } 35 36 if rf, ok := ret.Get(1).(func(context.Context, *types.AddNodeOptions) error); ok { 37 r1 = rf(_a0, _a1) 38 } else { 39 r1 = ret.Error(1) 40 } 41 42 return r0, r1 43 } 44 45 // AddPod provides a mock function with given fields: ctx, podname, desc 46 func (_m *Cluster) AddPod(ctx context.Context, podname string, desc string) (*types.Pod, error) { 47 ret := _m.Called(ctx, podname, desc) 48 49 var r0 *types.Pod 50 var r1 error 51 if rf, ok := ret.Get(0).(func(context.Context, string, string) (*types.Pod, error)); ok { 52 return rf(ctx, podname, desc) 53 } 54 if rf, ok := ret.Get(0).(func(context.Context, string, string) *types.Pod); ok { 55 r0 = rf(ctx, podname, desc) 56 } else { 57 if ret.Get(0) != nil { 58 r0 = ret.Get(0).(*types.Pod) 59 } 60 } 61 62 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 63 r1 = rf(ctx, podname, desc) 64 } else { 65 r1 = ret.Error(1) 66 } 67 68 return r0, r1 69 } 70 71 // BuildImage provides a mock function with given fields: ctx, opts 72 func (_m *Cluster) BuildImage(ctx context.Context, opts *types.BuildOptions) (chan *types.BuildImageMessage, error) { 73 ret := _m.Called(ctx, opts) 74 75 var r0 chan *types.BuildImageMessage 76 var r1 error 77 if rf, ok := ret.Get(0).(func(context.Context, *types.BuildOptions) (chan *types.BuildImageMessage, error)); ok { 78 return rf(ctx, opts) 79 } 80 if rf, ok := ret.Get(0).(func(context.Context, *types.BuildOptions) chan *types.BuildImageMessage); ok { 81 r0 = rf(ctx, opts) 82 } else { 83 if ret.Get(0) != nil { 84 r0 = ret.Get(0).(chan *types.BuildImageMessage) 85 } 86 } 87 88 if rf, ok := ret.Get(1).(func(context.Context, *types.BuildOptions) error); ok { 89 r1 = rf(ctx, opts) 90 } else { 91 r1 = ret.Error(1) 92 } 93 94 return r0, r1 95 } 96 97 // CacheImage provides a mock function with given fields: ctx, opts 98 func (_m *Cluster) CacheImage(ctx context.Context, opts *types.ImageOptions) (chan *types.CacheImageMessage, error) { 99 ret := _m.Called(ctx, opts) 100 101 var r0 chan *types.CacheImageMessage 102 var r1 error 103 if rf, ok := ret.Get(0).(func(context.Context, *types.ImageOptions) (chan *types.CacheImageMessage, error)); ok { 104 return rf(ctx, opts) 105 } 106 if rf, ok := ret.Get(0).(func(context.Context, *types.ImageOptions) chan *types.CacheImageMessage); ok { 107 r0 = rf(ctx, opts) 108 } else { 109 if ret.Get(0) != nil { 110 r0 = ret.Get(0).(chan *types.CacheImageMessage) 111 } 112 } 113 114 if rf, ok := ret.Get(1).(func(context.Context, *types.ImageOptions) error); ok { 115 r1 = rf(ctx, opts) 116 } else { 117 r1 = ret.Error(1) 118 } 119 120 return r0, r1 121 } 122 123 // CalculateCapacity provides a mock function with given fields: _a0, _a1 124 func (_m *Cluster) CalculateCapacity(_a0 context.Context, _a1 *types.DeployOptions) (*types.CapacityMessage, error) { 125 ret := _m.Called(_a0, _a1) 126 127 var r0 *types.CapacityMessage 128 var r1 error 129 if rf, ok := ret.Get(0).(func(context.Context, *types.DeployOptions) (*types.CapacityMessage, error)); ok { 130 return rf(_a0, _a1) 131 } 132 if rf, ok := ret.Get(0).(func(context.Context, *types.DeployOptions) *types.CapacityMessage); ok { 133 r0 = rf(_a0, _a1) 134 } else { 135 if ret.Get(0) != nil { 136 r0 = ret.Get(0).(*types.CapacityMessage) 137 } 138 } 139 140 if rf, ok := ret.Get(1).(func(context.Context, *types.DeployOptions) error); ok { 141 r1 = rf(_a0, _a1) 142 } else { 143 r1 = ret.Error(1) 144 } 145 146 return r0, r1 147 } 148 149 // ConnectNetwork provides a mock function with given fields: ctx, network, target, ipv4, ipv6 150 func (_m *Cluster) ConnectNetwork(ctx context.Context, network string, target string, ipv4 string, ipv6 string) ([]string, error) { 151 ret := _m.Called(ctx, network, target, ipv4, ipv6) 152 153 var r0 []string 154 var r1 error 155 if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string) ([]string, error)); ok { 156 return rf(ctx, network, target, ipv4, ipv6) 157 } 158 if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string) []string); ok { 159 r0 = rf(ctx, network, target, ipv4, ipv6) 160 } else { 161 if ret.Get(0) != nil { 162 r0 = ret.Get(0).([]string) 163 } 164 } 165 166 if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string) error); ok { 167 r1 = rf(ctx, network, target, ipv4, ipv6) 168 } else { 169 r1 = ret.Error(1) 170 } 171 172 return r0, r1 173 } 174 175 // ControlWorkload provides a mock function with given fields: ctx, IDs, t, force 176 func (_m *Cluster) ControlWorkload(ctx context.Context, IDs []string, t string, force bool) (chan *types.ControlWorkloadMessage, error) { 177 ret := _m.Called(ctx, IDs, t, force) 178 179 var r0 chan *types.ControlWorkloadMessage 180 var r1 error 181 if rf, ok := ret.Get(0).(func(context.Context, []string, string, bool) (chan *types.ControlWorkloadMessage, error)); ok { 182 return rf(ctx, IDs, t, force) 183 } 184 if rf, ok := ret.Get(0).(func(context.Context, []string, string, bool) chan *types.ControlWorkloadMessage); ok { 185 r0 = rf(ctx, IDs, t, force) 186 } else { 187 if ret.Get(0) != nil { 188 r0 = ret.Get(0).(chan *types.ControlWorkloadMessage) 189 } 190 } 191 192 if rf, ok := ret.Get(1).(func(context.Context, []string, string, bool) error); ok { 193 r1 = rf(ctx, IDs, t, force) 194 } else { 195 r1 = ret.Error(1) 196 } 197 198 return r0, r1 199 } 200 201 // Copy provides a mock function with given fields: ctx, opts 202 func (_m *Cluster) Copy(ctx context.Context, opts *types.CopyOptions) (chan *types.CopyMessage, error) { 203 ret := _m.Called(ctx, opts) 204 205 var r0 chan *types.CopyMessage 206 var r1 error 207 if rf, ok := ret.Get(0).(func(context.Context, *types.CopyOptions) (chan *types.CopyMessage, error)); ok { 208 return rf(ctx, opts) 209 } 210 if rf, ok := ret.Get(0).(func(context.Context, *types.CopyOptions) chan *types.CopyMessage); ok { 211 r0 = rf(ctx, opts) 212 } else { 213 if ret.Get(0) != nil { 214 r0 = ret.Get(0).(chan *types.CopyMessage) 215 } 216 } 217 218 if rf, ok := ret.Get(1).(func(context.Context, *types.CopyOptions) error); ok { 219 r1 = rf(ctx, opts) 220 } else { 221 r1 = ret.Error(1) 222 } 223 224 return r0, r1 225 } 226 227 // CreateWorkload provides a mock function with given fields: ctx, opts 228 func (_m *Cluster) CreateWorkload(ctx context.Context, opts *types.DeployOptions) (chan *types.CreateWorkloadMessage, error) { 229 ret := _m.Called(ctx, opts) 230 231 var r0 chan *types.CreateWorkloadMessage 232 var r1 error 233 if rf, ok := ret.Get(0).(func(context.Context, *types.DeployOptions) (chan *types.CreateWorkloadMessage, error)); ok { 234 return rf(ctx, opts) 235 } 236 if rf, ok := ret.Get(0).(func(context.Context, *types.DeployOptions) chan *types.CreateWorkloadMessage); ok { 237 r0 = rf(ctx, opts) 238 } else { 239 if ret.Get(0) != nil { 240 r0 = ret.Get(0).(chan *types.CreateWorkloadMessage) 241 } 242 } 243 244 if rf, ok := ret.Get(1).(func(context.Context, *types.DeployOptions) error); ok { 245 r1 = rf(ctx, opts) 246 } else { 247 r1 = ret.Error(1) 248 } 249 250 return r0, r1 251 } 252 253 // DisconnectNetwork provides a mock function with given fields: ctx, network, target, force 254 func (_m *Cluster) DisconnectNetwork(ctx context.Context, network string, target string, force bool) error { 255 ret := _m.Called(ctx, network, target, force) 256 257 var r0 error 258 if rf, ok := ret.Get(0).(func(context.Context, string, string, bool) error); ok { 259 r0 = rf(ctx, network, target, force) 260 } else { 261 r0 = ret.Error(0) 262 } 263 264 return r0 265 } 266 267 // DissociateWorkload provides a mock function with given fields: ctx, IDs 268 func (_m *Cluster) DissociateWorkload(ctx context.Context, IDs []string) (chan *types.DissociateWorkloadMessage, error) { 269 ret := _m.Called(ctx, IDs) 270 271 var r0 chan *types.DissociateWorkloadMessage 272 var r1 error 273 if rf, ok := ret.Get(0).(func(context.Context, []string) (chan *types.DissociateWorkloadMessage, error)); ok { 274 return rf(ctx, IDs) 275 } 276 if rf, ok := ret.Get(0).(func(context.Context, []string) chan *types.DissociateWorkloadMessage); ok { 277 r0 = rf(ctx, IDs) 278 } else { 279 if ret.Get(0) != nil { 280 r0 = ret.Get(0).(chan *types.DissociateWorkloadMessage) 281 } 282 } 283 284 if rf, ok := ret.Get(1).(func(context.Context, []string) error); ok { 285 r1 = rf(ctx, IDs) 286 } else { 287 r1 = ret.Error(1) 288 } 289 290 return r0, r1 291 } 292 293 // ExecuteWorkload provides a mock function with given fields: ctx, opts, inCh 294 func (_m *Cluster) ExecuteWorkload(ctx context.Context, opts *types.ExecuteWorkloadOptions, inCh <-chan []byte) chan *types.AttachWorkloadMessage { 295 ret := _m.Called(ctx, opts, inCh) 296 297 var r0 chan *types.AttachWorkloadMessage 298 if rf, ok := ret.Get(0).(func(context.Context, *types.ExecuteWorkloadOptions, <-chan []byte) chan *types.AttachWorkloadMessage); ok { 299 r0 = rf(ctx, opts, inCh) 300 } else { 301 if ret.Get(0) != nil { 302 r0 = ret.Get(0).(chan *types.AttachWorkloadMessage) 303 } 304 } 305 306 return r0 307 } 308 309 // Finalizer provides a mock function with given fields: 310 func (_m *Cluster) Finalizer() { 311 _m.Called() 312 } 313 314 // GetIdentifier provides a mock function with given fields: 315 func (_m *Cluster) GetIdentifier() string { 316 ret := _m.Called() 317 318 var r0 string 319 if rf, ok := ret.Get(0).(func() string); ok { 320 r0 = rf() 321 } else { 322 r0 = ret.Get(0).(string) 323 } 324 325 return r0 326 } 327 328 // GetNode provides a mock function with given fields: ctx, nodename 329 func (_m *Cluster) GetNode(ctx context.Context, nodename string) (*types.Node, error) { 330 ret := _m.Called(ctx, nodename) 331 332 var r0 *types.Node 333 var r1 error 334 if rf, ok := ret.Get(0).(func(context.Context, string) (*types.Node, error)); ok { 335 return rf(ctx, nodename) 336 } 337 if rf, ok := ret.Get(0).(func(context.Context, string) *types.Node); ok { 338 r0 = rf(ctx, nodename) 339 } else { 340 if ret.Get(0) != nil { 341 r0 = ret.Get(0).(*types.Node) 342 } 343 } 344 345 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 346 r1 = rf(ctx, nodename) 347 } else { 348 r1 = ret.Error(1) 349 } 350 351 return r0, r1 352 } 353 354 // GetNodeEngineInfo provides a mock function with given fields: ctx, nodename 355 func (_m *Cluster) GetNodeEngineInfo(ctx context.Context, nodename string) (*enginetypes.Info, error) { 356 ret := _m.Called(ctx, nodename) 357 358 var r0 *enginetypes.Info 359 var r1 error 360 if rf, ok := ret.Get(0).(func(context.Context, string) (*enginetypes.Info, error)); ok { 361 return rf(ctx, nodename) 362 } 363 if rf, ok := ret.Get(0).(func(context.Context, string) *enginetypes.Info); ok { 364 r0 = rf(ctx, nodename) 365 } else { 366 if ret.Get(0) != nil { 367 r0 = ret.Get(0).(*enginetypes.Info) 368 } 369 } 370 371 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 372 r1 = rf(ctx, nodename) 373 } else { 374 r1 = ret.Error(1) 375 } 376 377 return r0, r1 378 } 379 380 // GetNodeStatus provides a mock function with given fields: ctx, nodename 381 func (_m *Cluster) GetNodeStatus(ctx context.Context, nodename string) (*types.NodeStatus, error) { 382 ret := _m.Called(ctx, nodename) 383 384 var r0 *types.NodeStatus 385 var r1 error 386 if rf, ok := ret.Get(0).(func(context.Context, string) (*types.NodeStatus, error)); ok { 387 return rf(ctx, nodename) 388 } 389 if rf, ok := ret.Get(0).(func(context.Context, string) *types.NodeStatus); ok { 390 r0 = rf(ctx, nodename) 391 } else { 392 if ret.Get(0) != nil { 393 r0 = ret.Get(0).(*types.NodeStatus) 394 } 395 } 396 397 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 398 r1 = rf(ctx, nodename) 399 } else { 400 r1 = ret.Error(1) 401 } 402 403 return r0, r1 404 } 405 406 // GetPod provides a mock function with given fields: ctx, podname 407 func (_m *Cluster) GetPod(ctx context.Context, podname string) (*types.Pod, error) { 408 ret := _m.Called(ctx, podname) 409 410 var r0 *types.Pod 411 var r1 error 412 if rf, ok := ret.Get(0).(func(context.Context, string) (*types.Pod, error)); ok { 413 return rf(ctx, podname) 414 } 415 if rf, ok := ret.Get(0).(func(context.Context, string) *types.Pod); ok { 416 r0 = rf(ctx, podname) 417 } else { 418 if ret.Get(0) != nil { 419 r0 = ret.Get(0).(*types.Pod) 420 } 421 } 422 423 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 424 r1 = rf(ctx, podname) 425 } else { 426 r1 = ret.Error(1) 427 } 428 429 return r0, r1 430 } 431 432 // GetWorkload provides a mock function with given fields: ctx, id 433 func (_m *Cluster) GetWorkload(ctx context.Context, id string) (*types.Workload, error) { 434 ret := _m.Called(ctx, id) 435 436 var r0 *types.Workload 437 var r1 error 438 if rf, ok := ret.Get(0).(func(context.Context, string) (*types.Workload, error)); ok { 439 return rf(ctx, id) 440 } 441 if rf, ok := ret.Get(0).(func(context.Context, string) *types.Workload); ok { 442 r0 = rf(ctx, id) 443 } else { 444 if ret.Get(0) != nil { 445 r0 = ret.Get(0).(*types.Workload) 446 } 447 } 448 449 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 450 r1 = rf(ctx, id) 451 } else { 452 r1 = ret.Error(1) 453 } 454 455 return r0, r1 456 } 457 458 // GetWorkloads provides a mock function with given fields: ctx, IDs 459 func (_m *Cluster) GetWorkloads(ctx context.Context, IDs []string) ([]*types.Workload, error) { 460 ret := _m.Called(ctx, IDs) 461 462 var r0 []*types.Workload 463 var r1 error 464 if rf, ok := ret.Get(0).(func(context.Context, []string) ([]*types.Workload, error)); ok { 465 return rf(ctx, IDs) 466 } 467 if rf, ok := ret.Get(0).(func(context.Context, []string) []*types.Workload); ok { 468 r0 = rf(ctx, IDs) 469 } else { 470 if ret.Get(0) != nil { 471 r0 = ret.Get(0).([]*types.Workload) 472 } 473 } 474 475 if rf, ok := ret.Get(1).(func(context.Context, []string) error); ok { 476 r1 = rf(ctx, IDs) 477 } else { 478 r1 = ret.Error(1) 479 } 480 481 return r0, r1 482 } 483 484 // GetWorkloadsStatus provides a mock function with given fields: ctx, IDs 485 func (_m *Cluster) GetWorkloadsStatus(ctx context.Context, IDs []string) ([]*types.StatusMeta, error) { 486 ret := _m.Called(ctx, IDs) 487 488 var r0 []*types.StatusMeta 489 var r1 error 490 if rf, ok := ret.Get(0).(func(context.Context, []string) ([]*types.StatusMeta, error)); ok { 491 return rf(ctx, IDs) 492 } 493 if rf, ok := ret.Get(0).(func(context.Context, []string) []*types.StatusMeta); ok { 494 r0 = rf(ctx, IDs) 495 } else { 496 if ret.Get(0) != nil { 497 r0 = ret.Get(0).([]*types.StatusMeta) 498 } 499 } 500 501 if rf, ok := ret.Get(1).(func(context.Context, []string) error); ok { 502 r1 = rf(ctx, IDs) 503 } else { 504 r1 = ret.Error(1) 505 } 506 507 return r0, r1 508 } 509 510 // ListImage provides a mock function with given fields: ctx, opts 511 func (_m *Cluster) ListImage(ctx context.Context, opts *types.ImageOptions) (chan *types.ListImageMessage, error) { 512 ret := _m.Called(ctx, opts) 513 514 var r0 chan *types.ListImageMessage 515 var r1 error 516 if rf, ok := ret.Get(0).(func(context.Context, *types.ImageOptions) (chan *types.ListImageMessage, error)); ok { 517 return rf(ctx, opts) 518 } 519 if rf, ok := ret.Get(0).(func(context.Context, *types.ImageOptions) chan *types.ListImageMessage); ok { 520 r0 = rf(ctx, opts) 521 } else { 522 if ret.Get(0) != nil { 523 r0 = ret.Get(0).(chan *types.ListImageMessage) 524 } 525 } 526 527 if rf, ok := ret.Get(1).(func(context.Context, *types.ImageOptions) error); ok { 528 r1 = rf(ctx, opts) 529 } else { 530 r1 = ret.Error(1) 531 } 532 533 return r0, r1 534 } 535 536 // ListNetworks provides a mock function with given fields: ctx, podname, driver 537 func (_m *Cluster) ListNetworks(ctx context.Context, podname string, driver string) ([]*enginetypes.Network, error) { 538 ret := _m.Called(ctx, podname, driver) 539 540 var r0 []*enginetypes.Network 541 var r1 error 542 if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]*enginetypes.Network, error)); ok { 543 return rf(ctx, podname, driver) 544 } 545 if rf, ok := ret.Get(0).(func(context.Context, string, string) []*enginetypes.Network); ok { 546 r0 = rf(ctx, podname, driver) 547 } else { 548 if ret.Get(0) != nil { 549 r0 = ret.Get(0).([]*enginetypes.Network) 550 } 551 } 552 553 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 554 r1 = rf(ctx, podname, driver) 555 } else { 556 r1 = ret.Error(1) 557 } 558 559 return r0, r1 560 } 561 562 // ListNodeWorkloads provides a mock function with given fields: ctx, nodename, labels 563 func (_m *Cluster) ListNodeWorkloads(ctx context.Context, nodename string, labels map[string]string) ([]*types.Workload, error) { 564 ret := _m.Called(ctx, nodename, labels) 565 566 var r0 []*types.Workload 567 var r1 error 568 if rf, ok := ret.Get(0).(func(context.Context, string, map[string]string) ([]*types.Workload, error)); ok { 569 return rf(ctx, nodename, labels) 570 } 571 if rf, ok := ret.Get(0).(func(context.Context, string, map[string]string) []*types.Workload); ok { 572 r0 = rf(ctx, nodename, labels) 573 } else { 574 if ret.Get(0) != nil { 575 r0 = ret.Get(0).([]*types.Workload) 576 } 577 } 578 579 if rf, ok := ret.Get(1).(func(context.Context, string, map[string]string) error); ok { 580 r1 = rf(ctx, nodename, labels) 581 } else { 582 r1 = ret.Error(1) 583 } 584 585 return r0, r1 586 } 587 588 // ListPodNodes provides a mock function with given fields: _a0, _a1 589 func (_m *Cluster) ListPodNodes(_a0 context.Context, _a1 *types.ListNodesOptions) (<-chan *types.Node, error) { 590 ret := _m.Called(_a0, _a1) 591 592 var r0 <-chan *types.Node 593 var r1 error 594 if rf, ok := ret.Get(0).(func(context.Context, *types.ListNodesOptions) (<-chan *types.Node, error)); ok { 595 return rf(_a0, _a1) 596 } 597 if rf, ok := ret.Get(0).(func(context.Context, *types.ListNodesOptions) <-chan *types.Node); ok { 598 r0 = rf(_a0, _a1) 599 } else { 600 if ret.Get(0) != nil { 601 r0 = ret.Get(0).(<-chan *types.Node) 602 } 603 } 604 605 if rf, ok := ret.Get(1).(func(context.Context, *types.ListNodesOptions) error); ok { 606 r1 = rf(_a0, _a1) 607 } else { 608 r1 = ret.Error(1) 609 } 610 611 return r0, r1 612 } 613 614 // ListPods provides a mock function with given fields: ctx 615 func (_m *Cluster) ListPods(ctx context.Context) ([]*types.Pod, error) { 616 ret := _m.Called(ctx) 617 618 var r0 []*types.Pod 619 var r1 error 620 if rf, ok := ret.Get(0).(func(context.Context) ([]*types.Pod, error)); ok { 621 return rf(ctx) 622 } 623 if rf, ok := ret.Get(0).(func(context.Context) []*types.Pod); ok { 624 r0 = rf(ctx) 625 } else { 626 if ret.Get(0) != nil { 627 r0 = ret.Get(0).([]*types.Pod) 628 } 629 } 630 631 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 632 r1 = rf(ctx) 633 } else { 634 r1 = ret.Error(1) 635 } 636 637 return r0, r1 638 } 639 640 // ListWorkloads provides a mock function with given fields: ctx, opts 641 func (_m *Cluster) ListWorkloads(ctx context.Context, opts *types.ListWorkloadsOptions) ([]*types.Workload, error) { 642 ret := _m.Called(ctx, opts) 643 644 var r0 []*types.Workload 645 var r1 error 646 if rf, ok := ret.Get(0).(func(context.Context, *types.ListWorkloadsOptions) ([]*types.Workload, error)); ok { 647 return rf(ctx, opts) 648 } 649 if rf, ok := ret.Get(0).(func(context.Context, *types.ListWorkloadsOptions) []*types.Workload); ok { 650 r0 = rf(ctx, opts) 651 } else { 652 if ret.Get(0) != nil { 653 r0 = ret.Get(0).([]*types.Workload) 654 } 655 } 656 657 if rf, ok := ret.Get(1).(func(context.Context, *types.ListWorkloadsOptions) error); ok { 658 r1 = rf(ctx, opts) 659 } else { 660 r1 = ret.Error(1) 661 } 662 663 return r0, r1 664 } 665 666 // LogStream provides a mock function with given fields: ctx, opts 667 func (_m *Cluster) LogStream(ctx context.Context, opts *types.LogStreamOptions) (chan *types.LogStreamMessage, error) { 668 ret := _m.Called(ctx, opts) 669 670 var r0 chan *types.LogStreamMessage 671 var r1 error 672 if rf, ok := ret.Get(0).(func(context.Context, *types.LogStreamOptions) (chan *types.LogStreamMessage, error)); ok { 673 return rf(ctx, opts) 674 } 675 if rf, ok := ret.Get(0).(func(context.Context, *types.LogStreamOptions) chan *types.LogStreamMessage); ok { 676 r0 = rf(ctx, opts) 677 } else { 678 if ret.Get(0) != nil { 679 r0 = ret.Get(0).(chan *types.LogStreamMessage) 680 } 681 } 682 683 if rf, ok := ret.Get(1).(func(context.Context, *types.LogStreamOptions) error); ok { 684 r1 = rf(ctx, opts) 685 } else { 686 r1 = ret.Error(1) 687 } 688 689 return r0, r1 690 } 691 692 // NodeResource provides a mock function with given fields: ctx, nodename, fix 693 func (_m *Cluster) NodeResource(ctx context.Context, nodename string, fix bool) (*types.NodeResourceInfo, error) { 694 ret := _m.Called(ctx, nodename, fix) 695 696 var r0 *types.NodeResourceInfo 697 var r1 error 698 if rf, ok := ret.Get(0).(func(context.Context, string, bool) (*types.NodeResourceInfo, error)); ok { 699 return rf(ctx, nodename, fix) 700 } 701 if rf, ok := ret.Get(0).(func(context.Context, string, bool) *types.NodeResourceInfo); ok { 702 r0 = rf(ctx, nodename, fix) 703 } else { 704 if ret.Get(0) != nil { 705 r0 = ret.Get(0).(*types.NodeResourceInfo) 706 } 707 } 708 709 if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok { 710 r1 = rf(ctx, nodename, fix) 711 } else { 712 r1 = ret.Error(1) 713 } 714 715 return r0, r1 716 } 717 718 // NodeStatusStream provides a mock function with given fields: ctx 719 func (_m *Cluster) NodeStatusStream(ctx context.Context) chan *types.NodeStatus { 720 ret := _m.Called(ctx) 721 722 var r0 chan *types.NodeStatus 723 if rf, ok := ret.Get(0).(func(context.Context) chan *types.NodeStatus); ok { 724 r0 = rf(ctx) 725 } else { 726 if ret.Get(0) != nil { 727 r0 = ret.Get(0).(chan *types.NodeStatus) 728 } 729 } 730 731 return r0 732 } 733 734 // PodResource provides a mock function with given fields: ctx, podname 735 func (_m *Cluster) PodResource(ctx context.Context, podname string) (chan *types.NodeResourceInfo, error) { 736 ret := _m.Called(ctx, podname) 737 738 var r0 chan *types.NodeResourceInfo 739 var r1 error 740 if rf, ok := ret.Get(0).(func(context.Context, string) (chan *types.NodeResourceInfo, error)); ok { 741 return rf(ctx, podname) 742 } 743 if rf, ok := ret.Get(0).(func(context.Context, string) chan *types.NodeResourceInfo); ok { 744 r0 = rf(ctx, podname) 745 } else { 746 if ret.Get(0) != nil { 747 r0 = ret.Get(0).(chan *types.NodeResourceInfo) 748 } 749 } 750 751 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 752 r1 = rf(ctx, podname) 753 } else { 754 r1 = ret.Error(1) 755 } 756 757 return r0, r1 758 } 759 760 // RawEngine provides a mock function with given fields: ctx, opts 761 func (_m *Cluster) RawEngine(ctx context.Context, opts *types.RawEngineOptions) (*types.RawEngineMessage, error) { 762 ret := _m.Called(ctx, opts) 763 764 var r0 *types.RawEngineMessage 765 var r1 error 766 if rf, ok := ret.Get(0).(func(context.Context, *types.RawEngineOptions) (*types.RawEngineMessage, error)); ok { 767 return rf(ctx, opts) 768 } 769 if rf, ok := ret.Get(0).(func(context.Context, *types.RawEngineOptions) *types.RawEngineMessage); ok { 770 r0 = rf(ctx, opts) 771 } else { 772 if ret.Get(0) != nil { 773 r0 = ret.Get(0).(*types.RawEngineMessage) 774 } 775 } 776 777 if rf, ok := ret.Get(1).(func(context.Context, *types.RawEngineOptions) error); ok { 778 r1 = rf(ctx, opts) 779 } else { 780 r1 = ret.Error(1) 781 } 782 783 return r0, r1 784 } 785 786 // ReallocResource provides a mock function with given fields: ctx, opts 787 func (_m *Cluster) ReallocResource(ctx context.Context, opts *types.ReallocOptions) error { 788 ret := _m.Called(ctx, opts) 789 790 var r0 error 791 if rf, ok := ret.Get(0).(func(context.Context, *types.ReallocOptions) error); ok { 792 r0 = rf(ctx, opts) 793 } else { 794 r0 = ret.Error(0) 795 } 796 797 return r0 798 } 799 800 // RemoveImage provides a mock function with given fields: ctx, opts 801 func (_m *Cluster) RemoveImage(ctx context.Context, opts *types.ImageOptions) (chan *types.RemoveImageMessage, error) { 802 ret := _m.Called(ctx, opts) 803 804 var r0 chan *types.RemoveImageMessage 805 var r1 error 806 if rf, ok := ret.Get(0).(func(context.Context, *types.ImageOptions) (chan *types.RemoveImageMessage, error)); ok { 807 return rf(ctx, opts) 808 } 809 if rf, ok := ret.Get(0).(func(context.Context, *types.ImageOptions) chan *types.RemoveImageMessage); ok { 810 r0 = rf(ctx, opts) 811 } else { 812 if ret.Get(0) != nil { 813 r0 = ret.Get(0).(chan *types.RemoveImageMessage) 814 } 815 } 816 817 if rf, ok := ret.Get(1).(func(context.Context, *types.ImageOptions) error); ok { 818 r1 = rf(ctx, opts) 819 } else { 820 r1 = ret.Error(1) 821 } 822 823 return r0, r1 824 } 825 826 // RemoveNode provides a mock function with given fields: ctx, nodename 827 func (_m *Cluster) RemoveNode(ctx context.Context, nodename string) error { 828 ret := _m.Called(ctx, nodename) 829 830 var r0 error 831 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 832 r0 = rf(ctx, nodename) 833 } else { 834 r0 = ret.Error(0) 835 } 836 837 return r0 838 } 839 840 // RemovePod provides a mock function with given fields: ctx, podname 841 func (_m *Cluster) RemovePod(ctx context.Context, podname string) error { 842 ret := _m.Called(ctx, podname) 843 844 var r0 error 845 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 846 r0 = rf(ctx, podname) 847 } else { 848 r0 = ret.Error(0) 849 } 850 851 return r0 852 } 853 854 // RemoveWorkload provides a mock function with given fields: ctx, IDs, force 855 func (_m *Cluster) RemoveWorkload(ctx context.Context, IDs []string, force bool) (chan *types.RemoveWorkloadMessage, error) { 856 ret := _m.Called(ctx, IDs, force) 857 858 var r0 chan *types.RemoveWorkloadMessage 859 var r1 error 860 if rf, ok := ret.Get(0).(func(context.Context, []string, bool) (chan *types.RemoveWorkloadMessage, error)); ok { 861 return rf(ctx, IDs, force) 862 } 863 if rf, ok := ret.Get(0).(func(context.Context, []string, bool) chan *types.RemoveWorkloadMessage); ok { 864 r0 = rf(ctx, IDs, force) 865 } else { 866 if ret.Get(0) != nil { 867 r0 = ret.Get(0).(chan *types.RemoveWorkloadMessage) 868 } 869 } 870 871 if rf, ok := ret.Get(1).(func(context.Context, []string, bool) error); ok { 872 r1 = rf(ctx, IDs, force) 873 } else { 874 r1 = ret.Error(1) 875 } 876 877 return r0, r1 878 } 879 880 // RemoveWorkloadSync provides a mock function with given fields: ctx, IDs 881 func (_m *Cluster) RemoveWorkloadSync(ctx context.Context, IDs []string) error { 882 ret := _m.Called(ctx, IDs) 883 884 var r0 error 885 if rf, ok := ret.Get(0).(func(context.Context, []string) error); ok { 886 r0 = rf(ctx, IDs) 887 } else { 888 r0 = ret.Error(0) 889 } 890 891 return r0 892 } 893 894 // ReplaceWorkload provides a mock function with given fields: ctx, opts 895 func (_m *Cluster) ReplaceWorkload(ctx context.Context, opts *types.ReplaceOptions) (chan *types.ReplaceWorkloadMessage, error) { 896 ret := _m.Called(ctx, opts) 897 898 var r0 chan *types.ReplaceWorkloadMessage 899 var r1 error 900 if rf, ok := ret.Get(0).(func(context.Context, *types.ReplaceOptions) (chan *types.ReplaceWorkloadMessage, error)); ok { 901 return rf(ctx, opts) 902 } 903 if rf, ok := ret.Get(0).(func(context.Context, *types.ReplaceOptions) chan *types.ReplaceWorkloadMessage); ok { 904 r0 = rf(ctx, opts) 905 } else { 906 if ret.Get(0) != nil { 907 r0 = ret.Get(0).(chan *types.ReplaceWorkloadMessage) 908 } 909 } 910 911 if rf, ok := ret.Get(1).(func(context.Context, *types.ReplaceOptions) error); ok { 912 r1 = rf(ctx, opts) 913 } else { 914 r1 = ret.Error(1) 915 } 916 917 return r0, r1 918 } 919 920 // RunAndWait provides a mock function with given fields: ctx, opts, inCh 921 func (_m *Cluster) RunAndWait(ctx context.Context, opts *types.DeployOptions, inCh <-chan []byte) ([]string, <-chan *types.AttachWorkloadMessage, error) { 922 ret := _m.Called(ctx, opts, inCh) 923 924 var r0 []string 925 var r1 <-chan *types.AttachWorkloadMessage 926 var r2 error 927 if rf, ok := ret.Get(0).(func(context.Context, *types.DeployOptions, <-chan []byte) ([]string, <-chan *types.AttachWorkloadMessage, error)); ok { 928 return rf(ctx, opts, inCh) 929 } 930 if rf, ok := ret.Get(0).(func(context.Context, *types.DeployOptions, <-chan []byte) []string); ok { 931 r0 = rf(ctx, opts, inCh) 932 } else { 933 if ret.Get(0) != nil { 934 r0 = ret.Get(0).([]string) 935 } 936 } 937 938 if rf, ok := ret.Get(1).(func(context.Context, *types.DeployOptions, <-chan []byte) <-chan *types.AttachWorkloadMessage); ok { 939 r1 = rf(ctx, opts, inCh) 940 } else { 941 if ret.Get(1) != nil { 942 r1 = ret.Get(1).(<-chan *types.AttachWorkloadMessage) 943 } 944 } 945 946 if rf, ok := ret.Get(2).(func(context.Context, *types.DeployOptions, <-chan []byte) error); ok { 947 r2 = rf(ctx, opts, inCh) 948 } else { 949 r2 = ret.Error(2) 950 } 951 952 return r0, r1, r2 953 } 954 955 // Send provides a mock function with given fields: ctx, opts 956 func (_m *Cluster) Send(ctx context.Context, opts *types.SendOptions) (chan *types.SendMessage, error) { 957 ret := _m.Called(ctx, opts) 958 959 var r0 chan *types.SendMessage 960 var r1 error 961 if rf, ok := ret.Get(0).(func(context.Context, *types.SendOptions) (chan *types.SendMessage, error)); ok { 962 return rf(ctx, opts) 963 } 964 if rf, ok := ret.Get(0).(func(context.Context, *types.SendOptions) chan *types.SendMessage); ok { 965 r0 = rf(ctx, opts) 966 } else { 967 if ret.Get(0) != nil { 968 r0 = ret.Get(0).(chan *types.SendMessage) 969 } 970 } 971 972 if rf, ok := ret.Get(1).(func(context.Context, *types.SendOptions) error); ok { 973 r1 = rf(ctx, opts) 974 } else { 975 r1 = ret.Error(1) 976 } 977 978 return r0, r1 979 } 980 981 // SendLargeFile provides a mock function with given fields: ctx, opts 982 func (_m *Cluster) SendLargeFile(ctx context.Context, opts chan *types.SendLargeFileOptions) chan *types.SendMessage { 983 ret := _m.Called(ctx, opts) 984 985 var r0 chan *types.SendMessage 986 if rf, ok := ret.Get(0).(func(context.Context, chan *types.SendLargeFileOptions) chan *types.SendMessage); ok { 987 r0 = rf(ctx, opts) 988 } else { 989 if ret.Get(0) != nil { 990 r0 = ret.Get(0).(chan *types.SendMessage) 991 } 992 } 993 994 return r0 995 } 996 997 // SetNode provides a mock function with given fields: ctx, opts 998 func (_m *Cluster) SetNode(ctx context.Context, opts *types.SetNodeOptions) (*types.Node, error) { 999 ret := _m.Called(ctx, opts) 1000 1001 var r0 *types.Node 1002 var r1 error 1003 if rf, ok := ret.Get(0).(func(context.Context, *types.SetNodeOptions) (*types.Node, error)); ok { 1004 return rf(ctx, opts) 1005 } 1006 if rf, ok := ret.Get(0).(func(context.Context, *types.SetNodeOptions) *types.Node); ok { 1007 r0 = rf(ctx, opts) 1008 } else { 1009 if ret.Get(0) != nil { 1010 r0 = ret.Get(0).(*types.Node) 1011 } 1012 } 1013 1014 if rf, ok := ret.Get(1).(func(context.Context, *types.SetNodeOptions) error); ok { 1015 r1 = rf(ctx, opts) 1016 } else { 1017 r1 = ret.Error(1) 1018 } 1019 1020 return r0, r1 1021 } 1022 1023 // SetNodeStatus provides a mock function with given fields: ctx, nodename, ttl 1024 func (_m *Cluster) SetNodeStatus(ctx context.Context, nodename string, ttl int64) error { 1025 ret := _m.Called(ctx, nodename, ttl) 1026 1027 var r0 error 1028 if rf, ok := ret.Get(0).(func(context.Context, string, int64) error); ok { 1029 r0 = rf(ctx, nodename, ttl) 1030 } else { 1031 r0 = ret.Error(0) 1032 } 1033 1034 return r0 1035 } 1036 1037 // SetWorkloadsStatus provides a mock function with given fields: ctx, status, ttls 1038 func (_m *Cluster) SetWorkloadsStatus(ctx context.Context, status []*types.StatusMeta, ttls map[string]int64) ([]*types.StatusMeta, error) { 1039 ret := _m.Called(ctx, status, ttls) 1040 1041 var r0 []*types.StatusMeta 1042 var r1 error 1043 if rf, ok := ret.Get(0).(func(context.Context, []*types.StatusMeta, map[string]int64) ([]*types.StatusMeta, error)); ok { 1044 return rf(ctx, status, ttls) 1045 } 1046 if rf, ok := ret.Get(0).(func(context.Context, []*types.StatusMeta, map[string]int64) []*types.StatusMeta); ok { 1047 r0 = rf(ctx, status, ttls) 1048 } else { 1049 if ret.Get(0) != nil { 1050 r0 = ret.Get(0).([]*types.StatusMeta) 1051 } 1052 } 1053 1054 if rf, ok := ret.Get(1).(func(context.Context, []*types.StatusMeta, map[string]int64) error); ok { 1055 r1 = rf(ctx, status, ttls) 1056 } else { 1057 r1 = ret.Error(1) 1058 } 1059 1060 return r0, r1 1061 } 1062 1063 // WatchServiceStatus provides a mock function with given fields: _a0 1064 func (_m *Cluster) WatchServiceStatus(_a0 context.Context) (<-chan types.ServiceStatus, error) { 1065 ret := _m.Called(_a0) 1066 1067 var r0 <-chan types.ServiceStatus 1068 var r1 error 1069 if rf, ok := ret.Get(0).(func(context.Context) (<-chan types.ServiceStatus, error)); ok { 1070 return rf(_a0) 1071 } 1072 if rf, ok := ret.Get(0).(func(context.Context) <-chan types.ServiceStatus); ok { 1073 r0 = rf(_a0) 1074 } else { 1075 if ret.Get(0) != nil { 1076 r0 = ret.Get(0).(<-chan types.ServiceStatus) 1077 } 1078 } 1079 1080 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 1081 r1 = rf(_a0) 1082 } else { 1083 r1 = ret.Error(1) 1084 } 1085 1086 return r0, r1 1087 } 1088 1089 // WorkloadStatusStream provides a mock function with given fields: ctx, appname, entrypoint, nodename, labels 1090 func (_m *Cluster) WorkloadStatusStream(ctx context.Context, appname string, entrypoint string, nodename string, labels map[string]string) chan *types.WorkloadStatus { 1091 ret := _m.Called(ctx, appname, entrypoint, nodename, labels) 1092 1093 var r0 chan *types.WorkloadStatus 1094 if rf, ok := ret.Get(0).(func(context.Context, string, string, string, map[string]string) chan *types.WorkloadStatus); ok { 1095 r0 = rf(ctx, appname, entrypoint, nodename, labels) 1096 } else { 1097 if ret.Get(0) != nil { 1098 r0 = ret.Get(0).(chan *types.WorkloadStatus) 1099 } 1100 } 1101 1102 return r0 1103 } 1104 1105 // NewCluster creates a new instance of Cluster. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 1106 // The first argument is typically a *testing.T value. 1107 func NewCluster(t interface { 1108 mock.TestingT 1109 Cleanup(func()) 1110 }) *Cluster { 1111 mock := &Cluster{} 1112 mock.Mock.Test(t) 1113 1114 t.Cleanup(func() { mock.AssertExpectations(t) }) 1115 1116 return mock 1117 }