github.com/projecteru2/core@v0.0.0-20240321043226-06bcc1c23f58/engine/mocks/API.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 io "io" 9 10 mock "github.com/stretchr/testify/mock" 11 12 resourcetypes "github.com/projecteru2/core/resource/types" 13 14 source "github.com/projecteru2/core/source" 15 16 time "time" 17 18 types "github.com/projecteru2/core/engine/types" 19 ) 20 21 // API is an autogenerated mock type for the API type 22 type API struct { 23 mock.Mock 24 } 25 26 // BuildContent provides a mock function with given fields: ctx, scm, opts 27 func (_m *API) BuildContent(ctx context.Context, scm source.Source, opts *types.BuildContentOptions) (string, io.Reader, error) { 28 ret := _m.Called(ctx, scm, opts) 29 30 var r0 string 31 var r1 io.Reader 32 var r2 error 33 if rf, ok := ret.Get(0).(func(context.Context, source.Source, *types.BuildContentOptions) (string, io.Reader, error)); ok { 34 return rf(ctx, scm, opts) 35 } 36 if rf, ok := ret.Get(0).(func(context.Context, source.Source, *types.BuildContentOptions) string); ok { 37 r0 = rf(ctx, scm, opts) 38 } else { 39 r0 = ret.Get(0).(string) 40 } 41 42 if rf, ok := ret.Get(1).(func(context.Context, source.Source, *types.BuildContentOptions) io.Reader); ok { 43 r1 = rf(ctx, scm, opts) 44 } else { 45 if ret.Get(1) != nil { 46 r1 = ret.Get(1).(io.Reader) 47 } 48 } 49 50 if rf, ok := ret.Get(2).(func(context.Context, source.Source, *types.BuildContentOptions) error); ok { 51 r2 = rf(ctx, scm, opts) 52 } else { 53 r2 = ret.Error(2) 54 } 55 56 return r0, r1, r2 57 } 58 59 // BuildRefs provides a mock function with given fields: ctx, opts 60 func (_m *API) BuildRefs(ctx context.Context, opts *types.BuildRefOptions) []string { 61 ret := _m.Called(ctx, opts) 62 63 var r0 []string 64 if rf, ok := ret.Get(0).(func(context.Context, *types.BuildRefOptions) []string); ok { 65 r0 = rf(ctx, opts) 66 } else { 67 if ret.Get(0) != nil { 68 r0 = ret.Get(0).([]string) 69 } 70 } 71 72 return r0 73 } 74 75 // CloseConn provides a mock function with given fields: 76 func (_m *API) CloseConn() error { 77 ret := _m.Called() 78 79 var r0 error 80 if rf, ok := ret.Get(0).(func() error); ok { 81 r0 = rf() 82 } else { 83 r0 = ret.Error(0) 84 } 85 86 return r0 87 } 88 89 // ExecExitCode provides a mock function with given fields: ctx, ID, execID 90 func (_m *API) ExecExitCode(ctx context.Context, ID string, execID string) (int, error) { 91 ret := _m.Called(ctx, ID, execID) 92 93 var r0 int 94 var r1 error 95 if rf, ok := ret.Get(0).(func(context.Context, string, string) (int, error)); ok { 96 return rf(ctx, ID, execID) 97 } 98 if rf, ok := ret.Get(0).(func(context.Context, string, string) int); ok { 99 r0 = rf(ctx, ID, execID) 100 } else { 101 r0 = ret.Get(0).(int) 102 } 103 104 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 105 r1 = rf(ctx, ID, execID) 106 } else { 107 r1 = ret.Error(1) 108 } 109 110 return r0, r1 111 } 112 113 // ExecResize provides a mock function with given fields: ctx, execID, height, width 114 func (_m *API) ExecResize(ctx context.Context, execID string, height uint, width uint) error { 115 ret := _m.Called(ctx, execID, height, width) 116 117 var r0 error 118 if rf, ok := ret.Get(0).(func(context.Context, string, uint, uint) error); ok { 119 r0 = rf(ctx, execID, height, width) 120 } else { 121 r0 = ret.Error(0) 122 } 123 124 return r0 125 } 126 127 // Execute provides a mock function with given fields: ctx, ID, config 128 func (_m *API) Execute(ctx context.Context, ID string, config *types.ExecConfig) (string, io.ReadCloser, io.ReadCloser, io.WriteCloser, error) { 129 ret := _m.Called(ctx, ID, config) 130 131 var r0 string 132 var r1 io.ReadCloser 133 var r2 io.ReadCloser 134 var r3 io.WriteCloser 135 var r4 error 136 if rf, ok := ret.Get(0).(func(context.Context, string, *types.ExecConfig) (string, io.ReadCloser, io.ReadCloser, io.WriteCloser, error)); ok { 137 return rf(ctx, ID, config) 138 } 139 if rf, ok := ret.Get(0).(func(context.Context, string, *types.ExecConfig) string); ok { 140 r0 = rf(ctx, ID, config) 141 } else { 142 r0 = ret.Get(0).(string) 143 } 144 145 if rf, ok := ret.Get(1).(func(context.Context, string, *types.ExecConfig) io.ReadCloser); ok { 146 r1 = rf(ctx, ID, config) 147 } else { 148 if ret.Get(1) != nil { 149 r1 = ret.Get(1).(io.ReadCloser) 150 } 151 } 152 153 if rf, ok := ret.Get(2).(func(context.Context, string, *types.ExecConfig) io.ReadCloser); ok { 154 r2 = rf(ctx, ID, config) 155 } else { 156 if ret.Get(2) != nil { 157 r2 = ret.Get(2).(io.ReadCloser) 158 } 159 } 160 161 if rf, ok := ret.Get(3).(func(context.Context, string, *types.ExecConfig) io.WriteCloser); ok { 162 r3 = rf(ctx, ID, config) 163 } else { 164 if ret.Get(3) != nil { 165 r3 = ret.Get(3).(io.WriteCloser) 166 } 167 } 168 169 if rf, ok := ret.Get(4).(func(context.Context, string, *types.ExecConfig) error); ok { 170 r4 = rf(ctx, ID, config) 171 } else { 172 r4 = ret.Error(4) 173 } 174 175 return r0, r1, r2, r3, r4 176 } 177 178 // ImageBuild provides a mock function with given fields: ctx, input, refs, platform 179 func (_m *API) ImageBuild(ctx context.Context, input io.Reader, refs []string, platform string) (io.ReadCloser, error) { 180 ret := _m.Called(ctx, input, refs, platform) 181 182 var r0 io.ReadCloser 183 var r1 error 184 if rf, ok := ret.Get(0).(func(context.Context, io.Reader, []string, string) (io.ReadCloser, error)); ok { 185 return rf(ctx, input, refs, platform) 186 } 187 if rf, ok := ret.Get(0).(func(context.Context, io.Reader, []string, string) io.ReadCloser); ok { 188 r0 = rf(ctx, input, refs, platform) 189 } else { 190 if ret.Get(0) != nil { 191 r0 = ret.Get(0).(io.ReadCloser) 192 } 193 } 194 195 if rf, ok := ret.Get(1).(func(context.Context, io.Reader, []string, string) error); ok { 196 r1 = rf(ctx, input, refs, platform) 197 } else { 198 r1 = ret.Error(1) 199 } 200 201 return r0, r1 202 } 203 204 // ImageBuildCachePrune provides a mock function with given fields: ctx, all 205 func (_m *API) ImageBuildCachePrune(ctx context.Context, all bool) (uint64, error) { 206 ret := _m.Called(ctx, all) 207 208 var r0 uint64 209 var r1 error 210 if rf, ok := ret.Get(0).(func(context.Context, bool) (uint64, error)); ok { 211 return rf(ctx, all) 212 } 213 if rf, ok := ret.Get(0).(func(context.Context, bool) uint64); ok { 214 r0 = rf(ctx, all) 215 } else { 216 r0 = ret.Get(0).(uint64) 217 } 218 219 if rf, ok := ret.Get(1).(func(context.Context, bool) error); ok { 220 r1 = rf(ctx, all) 221 } else { 222 r1 = ret.Error(1) 223 } 224 225 return r0, r1 226 } 227 228 // ImageBuildFromExist provides a mock function with given fields: ctx, ID, refs, user 229 func (_m *API) ImageBuildFromExist(ctx context.Context, ID string, refs []string, user string) (string, error) { 230 ret := _m.Called(ctx, ID, refs, user) 231 232 var r0 string 233 var r1 error 234 if rf, ok := ret.Get(0).(func(context.Context, string, []string, string) (string, error)); ok { 235 return rf(ctx, ID, refs, user) 236 } 237 if rf, ok := ret.Get(0).(func(context.Context, string, []string, string) string); ok { 238 r0 = rf(ctx, ID, refs, user) 239 } else { 240 r0 = ret.Get(0).(string) 241 } 242 243 if rf, ok := ret.Get(1).(func(context.Context, string, []string, string) error); ok { 244 r1 = rf(ctx, ID, refs, user) 245 } else { 246 r1 = ret.Error(1) 247 } 248 249 return r0, r1 250 } 251 252 // ImageList provides a mock function with given fields: ctx, image 253 func (_m *API) ImageList(ctx context.Context, image string) ([]*types.Image, error) { 254 ret := _m.Called(ctx, image) 255 256 var r0 []*types.Image 257 var r1 error 258 if rf, ok := ret.Get(0).(func(context.Context, string) ([]*types.Image, error)); ok { 259 return rf(ctx, image) 260 } 261 if rf, ok := ret.Get(0).(func(context.Context, string) []*types.Image); ok { 262 r0 = rf(ctx, image) 263 } else { 264 if ret.Get(0) != nil { 265 r0 = ret.Get(0).([]*types.Image) 266 } 267 } 268 269 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 270 r1 = rf(ctx, image) 271 } else { 272 r1 = ret.Error(1) 273 } 274 275 return r0, r1 276 } 277 278 // ImageLocalDigests provides a mock function with given fields: ctx, image 279 func (_m *API) ImageLocalDigests(ctx context.Context, image string) ([]string, error) { 280 ret := _m.Called(ctx, image) 281 282 var r0 []string 283 var r1 error 284 if rf, ok := ret.Get(0).(func(context.Context, string) ([]string, error)); ok { 285 return rf(ctx, image) 286 } 287 if rf, ok := ret.Get(0).(func(context.Context, string) []string); ok { 288 r0 = rf(ctx, image) 289 } else { 290 if ret.Get(0) != nil { 291 r0 = ret.Get(0).([]string) 292 } 293 } 294 295 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 296 r1 = rf(ctx, image) 297 } else { 298 r1 = ret.Error(1) 299 } 300 301 return r0, r1 302 } 303 304 // ImagePull provides a mock function with given fields: ctx, ref, all 305 func (_m *API) ImagePull(ctx context.Context, ref string, all bool) (io.ReadCloser, error) { 306 ret := _m.Called(ctx, ref, all) 307 308 var r0 io.ReadCloser 309 var r1 error 310 if rf, ok := ret.Get(0).(func(context.Context, string, bool) (io.ReadCloser, error)); ok { 311 return rf(ctx, ref, all) 312 } 313 if rf, ok := ret.Get(0).(func(context.Context, string, bool) io.ReadCloser); ok { 314 r0 = rf(ctx, ref, all) 315 } else { 316 if ret.Get(0) != nil { 317 r0 = ret.Get(0).(io.ReadCloser) 318 } 319 } 320 321 if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok { 322 r1 = rf(ctx, ref, all) 323 } else { 324 r1 = ret.Error(1) 325 } 326 327 return r0, r1 328 } 329 330 // ImagePush provides a mock function with given fields: ctx, ref 331 func (_m *API) ImagePush(ctx context.Context, ref string) (io.ReadCloser, error) { 332 ret := _m.Called(ctx, ref) 333 334 var r0 io.ReadCloser 335 var r1 error 336 if rf, ok := ret.Get(0).(func(context.Context, string) (io.ReadCloser, error)); ok { 337 return rf(ctx, ref) 338 } 339 if rf, ok := ret.Get(0).(func(context.Context, string) io.ReadCloser); ok { 340 r0 = rf(ctx, ref) 341 } else { 342 if ret.Get(0) != nil { 343 r0 = ret.Get(0).(io.ReadCloser) 344 } 345 } 346 347 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 348 r1 = rf(ctx, ref) 349 } else { 350 r1 = ret.Error(1) 351 } 352 353 return r0, r1 354 } 355 356 // ImageRemoteDigest provides a mock function with given fields: ctx, image 357 func (_m *API) ImageRemoteDigest(ctx context.Context, image string) (string, error) { 358 ret := _m.Called(ctx, image) 359 360 var r0 string 361 var r1 error 362 if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { 363 return rf(ctx, image) 364 } 365 if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { 366 r0 = rf(ctx, image) 367 } else { 368 r0 = ret.Get(0).(string) 369 } 370 371 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 372 r1 = rf(ctx, image) 373 } else { 374 r1 = ret.Error(1) 375 } 376 377 return r0, r1 378 } 379 380 // ImageRemove provides a mock function with given fields: ctx, image, force, prune 381 func (_m *API) ImageRemove(ctx context.Context, image string, force bool, prune bool) ([]string, error) { 382 ret := _m.Called(ctx, image, force, prune) 383 384 var r0 []string 385 var r1 error 386 if rf, ok := ret.Get(0).(func(context.Context, string, bool, bool) ([]string, error)); ok { 387 return rf(ctx, image, force, prune) 388 } 389 if rf, ok := ret.Get(0).(func(context.Context, string, bool, bool) []string); ok { 390 r0 = rf(ctx, image, force, prune) 391 } else { 392 if ret.Get(0) != nil { 393 r0 = ret.Get(0).([]string) 394 } 395 } 396 397 if rf, ok := ret.Get(1).(func(context.Context, string, bool, bool) error); ok { 398 r1 = rf(ctx, image, force, prune) 399 } else { 400 r1 = ret.Error(1) 401 } 402 403 return r0, r1 404 } 405 406 // ImagesPrune provides a mock function with given fields: ctx 407 func (_m *API) ImagesPrune(ctx context.Context) error { 408 ret := _m.Called(ctx) 409 410 var r0 error 411 if rf, ok := ret.Get(0).(func(context.Context) error); ok { 412 r0 = rf(ctx) 413 } else { 414 r0 = ret.Error(0) 415 } 416 417 return r0 418 } 419 420 // Info provides a mock function with given fields: ctx 421 func (_m *API) Info(ctx context.Context) (*types.Info, error) { 422 ret := _m.Called(ctx) 423 424 var r0 *types.Info 425 var r1 error 426 if rf, ok := ret.Get(0).(func(context.Context) (*types.Info, error)); ok { 427 return rf(ctx) 428 } 429 if rf, ok := ret.Get(0).(func(context.Context) *types.Info); ok { 430 r0 = rf(ctx) 431 } else { 432 if ret.Get(0) != nil { 433 r0 = ret.Get(0).(*types.Info) 434 } 435 } 436 437 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 438 r1 = rf(ctx) 439 } else { 440 r1 = ret.Error(1) 441 } 442 443 return r0, r1 444 } 445 446 // NetworkConnect provides a mock function with given fields: ctx, network, target, ipv4, ipv6 447 func (_m *API) NetworkConnect(ctx context.Context, network string, target string, ipv4 string, ipv6 string) ([]string, error) { 448 ret := _m.Called(ctx, network, target, ipv4, ipv6) 449 450 var r0 []string 451 var r1 error 452 if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string) ([]string, error)); ok { 453 return rf(ctx, network, target, ipv4, ipv6) 454 } 455 if rf, ok := ret.Get(0).(func(context.Context, string, string, string, string) []string); ok { 456 r0 = rf(ctx, network, target, ipv4, ipv6) 457 } else { 458 if ret.Get(0) != nil { 459 r0 = ret.Get(0).([]string) 460 } 461 } 462 463 if rf, ok := ret.Get(1).(func(context.Context, string, string, string, string) error); ok { 464 r1 = rf(ctx, network, target, ipv4, ipv6) 465 } else { 466 r1 = ret.Error(1) 467 } 468 469 return r0, r1 470 } 471 472 // NetworkDisconnect provides a mock function with given fields: ctx, network, target, force 473 func (_m *API) NetworkDisconnect(ctx context.Context, network string, target string, force bool) error { 474 ret := _m.Called(ctx, network, target, force) 475 476 var r0 error 477 if rf, ok := ret.Get(0).(func(context.Context, string, string, bool) error); ok { 478 r0 = rf(ctx, network, target, force) 479 } else { 480 r0 = ret.Error(0) 481 } 482 483 return r0 484 } 485 486 // NetworkList provides a mock function with given fields: ctx, drivers 487 func (_m *API) NetworkList(ctx context.Context, drivers []string) ([]*types.Network, error) { 488 ret := _m.Called(ctx, drivers) 489 490 var r0 []*types.Network 491 var r1 error 492 if rf, ok := ret.Get(0).(func(context.Context, []string) ([]*types.Network, error)); ok { 493 return rf(ctx, drivers) 494 } 495 if rf, ok := ret.Get(0).(func(context.Context, []string) []*types.Network); ok { 496 r0 = rf(ctx, drivers) 497 } else { 498 if ret.Get(0) != nil { 499 r0 = ret.Get(0).([]*types.Network) 500 } 501 } 502 503 if rf, ok := ret.Get(1).(func(context.Context, []string) error); ok { 504 r1 = rf(ctx, drivers) 505 } else { 506 r1 = ret.Error(1) 507 } 508 509 return r0, r1 510 } 511 512 // Ping provides a mock function with given fields: ctx 513 func (_m *API) Ping(ctx context.Context) error { 514 ret := _m.Called(ctx) 515 516 var r0 error 517 if rf, ok := ret.Get(0).(func(context.Context) error); ok { 518 r0 = rf(ctx) 519 } else { 520 r0 = ret.Error(0) 521 } 522 523 return r0 524 } 525 526 // RawEngine provides a mock function with given fields: ctx, opts 527 func (_m *API) RawEngine(ctx context.Context, opts *types.RawEngineOptions) (*types.RawEngineResult, error) { 528 ret := _m.Called(ctx, opts) 529 530 var r0 *types.RawEngineResult 531 var r1 error 532 if rf, ok := ret.Get(0).(func(context.Context, *types.RawEngineOptions) (*types.RawEngineResult, error)); ok { 533 return rf(ctx, opts) 534 } 535 if rf, ok := ret.Get(0).(func(context.Context, *types.RawEngineOptions) *types.RawEngineResult); ok { 536 r0 = rf(ctx, opts) 537 } else { 538 if ret.Get(0) != nil { 539 r0 = ret.Get(0).(*types.RawEngineResult) 540 } 541 } 542 543 if rf, ok := ret.Get(1).(func(context.Context, *types.RawEngineOptions) error); ok { 544 r1 = rf(ctx, opts) 545 } else { 546 r1 = ret.Error(1) 547 } 548 549 return r0, r1 550 } 551 552 // VirtualizationAttach provides a mock function with given fields: ctx, ID, stream, openStdin 553 func (_m *API) VirtualizationAttach(ctx context.Context, ID string, stream bool, openStdin bool) (io.ReadCloser, io.ReadCloser, io.WriteCloser, error) { 554 ret := _m.Called(ctx, ID, stream, openStdin) 555 556 var r0 io.ReadCloser 557 var r1 io.ReadCloser 558 var r2 io.WriteCloser 559 var r3 error 560 if rf, ok := ret.Get(0).(func(context.Context, string, bool, bool) (io.ReadCloser, io.ReadCloser, io.WriteCloser, error)); ok { 561 return rf(ctx, ID, stream, openStdin) 562 } 563 if rf, ok := ret.Get(0).(func(context.Context, string, bool, bool) io.ReadCloser); ok { 564 r0 = rf(ctx, ID, stream, openStdin) 565 } else { 566 if ret.Get(0) != nil { 567 r0 = ret.Get(0).(io.ReadCloser) 568 } 569 } 570 571 if rf, ok := ret.Get(1).(func(context.Context, string, bool, bool) io.ReadCloser); ok { 572 r1 = rf(ctx, ID, stream, openStdin) 573 } else { 574 if ret.Get(1) != nil { 575 r1 = ret.Get(1).(io.ReadCloser) 576 } 577 } 578 579 if rf, ok := ret.Get(2).(func(context.Context, string, bool, bool) io.WriteCloser); ok { 580 r2 = rf(ctx, ID, stream, openStdin) 581 } else { 582 if ret.Get(2) != nil { 583 r2 = ret.Get(2).(io.WriteCloser) 584 } 585 } 586 587 if rf, ok := ret.Get(3).(func(context.Context, string, bool, bool) error); ok { 588 r3 = rf(ctx, ID, stream, openStdin) 589 } else { 590 r3 = ret.Error(3) 591 } 592 593 return r0, r1, r2, r3 594 } 595 596 // VirtualizationCopyChunkTo provides a mock function with given fields: ctx, ID, target, size, content, uid, gid, mode 597 func (_m *API) VirtualizationCopyChunkTo(ctx context.Context, ID string, target string, size int64, content io.Reader, uid int, gid int, mode int64) error { 598 ret := _m.Called(ctx, ID, target, size, content, uid, gid, mode) 599 600 var r0 error 601 if rf, ok := ret.Get(0).(func(context.Context, string, string, int64, io.Reader, int, int, int64) error); ok { 602 r0 = rf(ctx, ID, target, size, content, uid, gid, mode) 603 } else { 604 r0 = ret.Error(0) 605 } 606 607 return r0 608 } 609 610 // VirtualizationCopyFrom provides a mock function with given fields: ctx, ID, path 611 func (_m *API) VirtualizationCopyFrom(ctx context.Context, ID string, path string) ([]byte, int, int, int64, error) { 612 ret := _m.Called(ctx, ID, path) 613 614 var r0 []byte 615 var r1 int 616 var r2 int 617 var r3 int64 618 var r4 error 619 if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]byte, int, int, int64, error)); ok { 620 return rf(ctx, ID, path) 621 } 622 if rf, ok := ret.Get(0).(func(context.Context, string, string) []byte); ok { 623 r0 = rf(ctx, ID, path) 624 } else { 625 if ret.Get(0) != nil { 626 r0 = ret.Get(0).([]byte) 627 } 628 } 629 630 if rf, ok := ret.Get(1).(func(context.Context, string, string) int); ok { 631 r1 = rf(ctx, ID, path) 632 } else { 633 r1 = ret.Get(1).(int) 634 } 635 636 if rf, ok := ret.Get(2).(func(context.Context, string, string) int); ok { 637 r2 = rf(ctx, ID, path) 638 } else { 639 r2 = ret.Get(2).(int) 640 } 641 642 if rf, ok := ret.Get(3).(func(context.Context, string, string) int64); ok { 643 r3 = rf(ctx, ID, path) 644 } else { 645 r3 = ret.Get(3).(int64) 646 } 647 648 if rf, ok := ret.Get(4).(func(context.Context, string, string) error); ok { 649 r4 = rf(ctx, ID, path) 650 } else { 651 r4 = ret.Error(4) 652 } 653 654 return r0, r1, r2, r3, r4 655 } 656 657 // VirtualizationCopyTo provides a mock function with given fields: ctx, ID, target, content, uid, gid, mode 658 func (_m *API) VirtualizationCopyTo(ctx context.Context, ID string, target string, content []byte, uid int, gid int, mode int64) error { 659 ret := _m.Called(ctx, ID, target, content, uid, gid, mode) 660 661 var r0 error 662 if rf, ok := ret.Get(0).(func(context.Context, string, string, []byte, int, int, int64) error); ok { 663 r0 = rf(ctx, ID, target, content, uid, gid, mode) 664 } else { 665 r0 = ret.Error(0) 666 } 667 668 return r0 669 } 670 671 // VirtualizationCreate provides a mock function with given fields: ctx, opts 672 func (_m *API) VirtualizationCreate(ctx context.Context, opts *types.VirtualizationCreateOptions) (*types.VirtualizationCreated, error) { 673 ret := _m.Called(ctx, opts) 674 675 var r0 *types.VirtualizationCreated 676 var r1 error 677 if rf, ok := ret.Get(0).(func(context.Context, *types.VirtualizationCreateOptions) (*types.VirtualizationCreated, error)); ok { 678 return rf(ctx, opts) 679 } 680 if rf, ok := ret.Get(0).(func(context.Context, *types.VirtualizationCreateOptions) *types.VirtualizationCreated); ok { 681 r0 = rf(ctx, opts) 682 } else { 683 if ret.Get(0) != nil { 684 r0 = ret.Get(0).(*types.VirtualizationCreated) 685 } 686 } 687 688 if rf, ok := ret.Get(1).(func(context.Context, *types.VirtualizationCreateOptions) error); ok { 689 r1 = rf(ctx, opts) 690 } else { 691 r1 = ret.Error(1) 692 } 693 694 return r0, r1 695 } 696 697 // VirtualizationInspect provides a mock function with given fields: ctx, ID 698 func (_m *API) VirtualizationInspect(ctx context.Context, ID string) (*types.VirtualizationInfo, error) { 699 ret := _m.Called(ctx, ID) 700 701 var r0 *types.VirtualizationInfo 702 var r1 error 703 if rf, ok := ret.Get(0).(func(context.Context, string) (*types.VirtualizationInfo, error)); ok { 704 return rf(ctx, ID) 705 } 706 if rf, ok := ret.Get(0).(func(context.Context, string) *types.VirtualizationInfo); ok { 707 r0 = rf(ctx, ID) 708 } else { 709 if ret.Get(0) != nil { 710 r0 = ret.Get(0).(*types.VirtualizationInfo) 711 } 712 } 713 714 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 715 r1 = rf(ctx, ID) 716 } else { 717 r1 = ret.Error(1) 718 } 719 720 return r0, r1 721 } 722 723 // VirtualizationLogs provides a mock function with given fields: ctx, opts 724 func (_m *API) VirtualizationLogs(ctx context.Context, opts *types.VirtualizationLogStreamOptions) (io.ReadCloser, io.ReadCloser, error) { 725 ret := _m.Called(ctx, opts) 726 727 var r0 io.ReadCloser 728 var r1 io.ReadCloser 729 var r2 error 730 if rf, ok := ret.Get(0).(func(context.Context, *types.VirtualizationLogStreamOptions) (io.ReadCloser, io.ReadCloser, error)); ok { 731 return rf(ctx, opts) 732 } 733 if rf, ok := ret.Get(0).(func(context.Context, *types.VirtualizationLogStreamOptions) io.ReadCloser); ok { 734 r0 = rf(ctx, opts) 735 } else { 736 if ret.Get(0) != nil { 737 r0 = ret.Get(0).(io.ReadCloser) 738 } 739 } 740 741 if rf, ok := ret.Get(1).(func(context.Context, *types.VirtualizationLogStreamOptions) io.ReadCloser); ok { 742 r1 = rf(ctx, opts) 743 } else { 744 if ret.Get(1) != nil { 745 r1 = ret.Get(1).(io.ReadCloser) 746 } 747 } 748 749 if rf, ok := ret.Get(2).(func(context.Context, *types.VirtualizationLogStreamOptions) error); ok { 750 r2 = rf(ctx, opts) 751 } else { 752 r2 = ret.Error(2) 753 } 754 755 return r0, r1, r2 756 } 757 758 // VirtualizationRemove provides a mock function with given fields: ctx, ID, volumes, force 759 func (_m *API) VirtualizationRemove(ctx context.Context, ID string, volumes bool, force bool) error { 760 ret := _m.Called(ctx, ID, volumes, force) 761 762 var r0 error 763 if rf, ok := ret.Get(0).(func(context.Context, string, bool, bool) error); ok { 764 r0 = rf(ctx, ID, volumes, force) 765 } else { 766 r0 = ret.Error(0) 767 } 768 769 return r0 770 } 771 772 // VirtualizationResize provides a mock function with given fields: ctx, ID, height, width 773 func (_m *API) VirtualizationResize(ctx context.Context, ID string, height uint, width uint) error { 774 ret := _m.Called(ctx, ID, height, width) 775 776 var r0 error 777 if rf, ok := ret.Get(0).(func(context.Context, string, uint, uint) error); ok { 778 r0 = rf(ctx, ID, height, width) 779 } else { 780 r0 = ret.Error(0) 781 } 782 783 return r0 784 } 785 786 // VirtualizationResume provides a mock function with given fields: ctx, ID 787 func (_m *API) VirtualizationResume(ctx context.Context, ID string) error { 788 ret := _m.Called(ctx, ID) 789 790 var r0 error 791 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 792 r0 = rf(ctx, ID) 793 } else { 794 r0 = ret.Error(0) 795 } 796 797 return r0 798 } 799 800 // VirtualizationStart provides a mock function with given fields: ctx, ID 801 func (_m *API) VirtualizationStart(ctx context.Context, ID string) error { 802 ret := _m.Called(ctx, ID) 803 804 var r0 error 805 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 806 r0 = rf(ctx, ID) 807 } else { 808 r0 = ret.Error(0) 809 } 810 811 return r0 812 } 813 814 // VirtualizationStop provides a mock function with given fields: ctx, ID, gracefulTimeout 815 func (_m *API) VirtualizationStop(ctx context.Context, ID string, gracefulTimeout time.Duration) error { 816 ret := _m.Called(ctx, ID, gracefulTimeout) 817 818 var r0 error 819 if rf, ok := ret.Get(0).(func(context.Context, string, time.Duration) error); ok { 820 r0 = rf(ctx, ID, gracefulTimeout) 821 } else { 822 r0 = ret.Error(0) 823 } 824 825 return r0 826 } 827 828 // VirtualizationSuspend provides a mock function with given fields: ctx, ID 829 func (_m *API) VirtualizationSuspend(ctx context.Context, ID string) error { 830 ret := _m.Called(ctx, ID) 831 832 var r0 error 833 if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { 834 r0 = rf(ctx, ID) 835 } else { 836 r0 = ret.Error(0) 837 } 838 839 return r0 840 } 841 842 // VirtualizationUpdateResource provides a mock function with given fields: ctx, ID, params 843 func (_m *API) VirtualizationUpdateResource(ctx context.Context, ID string, params resourcetypes.Resources) error { 844 ret := _m.Called(ctx, ID, params) 845 846 var r0 error 847 if rf, ok := ret.Get(0).(func(context.Context, string, resourcetypes.Resources) error); ok { 848 r0 = rf(ctx, ID, params) 849 } else { 850 r0 = ret.Error(0) 851 } 852 853 return r0 854 } 855 856 // VirtualizationWait provides a mock function with given fields: ctx, ID, state 857 func (_m *API) VirtualizationWait(ctx context.Context, ID string, state string) (*types.VirtualizationWaitResult, error) { 858 ret := _m.Called(ctx, ID, state) 859 860 var r0 *types.VirtualizationWaitResult 861 var r1 error 862 if rf, ok := ret.Get(0).(func(context.Context, string, string) (*types.VirtualizationWaitResult, error)); ok { 863 return rf(ctx, ID, state) 864 } 865 if rf, ok := ret.Get(0).(func(context.Context, string, string) *types.VirtualizationWaitResult); ok { 866 r0 = rf(ctx, ID, state) 867 } else { 868 if ret.Get(0) != nil { 869 r0 = ret.Get(0).(*types.VirtualizationWaitResult) 870 } 871 } 872 873 if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { 874 r1 = rf(ctx, ID, state) 875 } else { 876 r1 = ret.Error(1) 877 } 878 879 return r0, r1 880 } 881 882 // NewAPI creates a new instance of API. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 883 // The first argument is typically a *testing.T value. 884 func NewAPI(t interface { 885 mock.TestingT 886 Cleanup(func()) 887 }) *API { 888 mock := &API{} 889 mock.Mock.Test(t) 890 891 t.Cleanup(func() { mock.AssertExpectations(t) }) 892 893 return mock 894 }