github.com/khulnasoft-lab/tunnel-db@v0.0.0-20231117205118-74e1113bd007/pkg/vulnsrc/alma/mock_db.go (about) 1 // Code generated by mockery v1.0.0. DO NOT EDIT. 2 3 package alma 4 5 import ( 6 db "github.com/khulnasoft-lab/tunnel-db/pkg/db" 7 mock "github.com/stretchr/testify/mock" 8 bbolt "go.etcd.io/bbolt" 9 10 types "github.com/khulnasoft-lab/tunnel-db/pkg/types" 11 ) 12 13 // MockDB is an autogenerated mock type for the DB type 14 type MockDB struct { 15 mock.Mock 16 } 17 18 type DBBatchUpdateArgs struct { 19 Fn func(*bbolt.Tx) error 20 FnAnything bool 21 } 22 23 type DBBatchUpdateReturns struct { 24 Err error 25 } 26 27 type DBBatchUpdateExpectation struct { 28 Args DBBatchUpdateArgs 29 Returns DBBatchUpdateReturns 30 } 31 32 func (_m *MockDB) ApplyBatchUpdateExpectation(e DBBatchUpdateExpectation) { 33 var args []interface{} 34 if e.Args.FnAnything { 35 args = append(args, mock.Anything) 36 } else { 37 args = append(args, e.Args.Fn) 38 } 39 _m.On("BatchUpdate", args...).Return(e.Returns.Err) 40 } 41 42 func (_m *MockDB) ApplyBatchUpdateExpectations(expectations []DBBatchUpdateExpectation) { 43 for _, e := range expectations { 44 _m.ApplyBatchUpdateExpectation(e) 45 } 46 } 47 48 // BatchUpdate provides a mock function with given fields: fn 49 func (_m *MockDB) BatchUpdate(fn func(*bbolt.Tx) error) error { 50 ret := _m.Called(fn) 51 52 var r0 error 53 if rf, ok := ret.Get(0).(func(func(*bbolt.Tx) error) error); ok { 54 r0 = rf(fn) 55 } else { 56 r0 = ret.Error(0) 57 } 58 59 return r0 60 } 61 62 type DBDeleteAdvisoryDetailBucketReturns struct { 63 _a0 error 64 } 65 66 type DBDeleteAdvisoryDetailBucketExpectation struct { 67 Returns DBDeleteAdvisoryDetailBucketReturns 68 } 69 70 func (_m *MockDB) ApplyDeleteAdvisoryDetailBucketExpectation(e DBDeleteAdvisoryDetailBucketExpectation) { 71 var args []interface{} 72 _m.On("DeleteAdvisoryDetailBucket", args...).Return(e.Returns._a0) 73 } 74 75 func (_m *MockDB) ApplyDeleteAdvisoryDetailBucketExpectations(expectations []DBDeleteAdvisoryDetailBucketExpectation) { 76 for _, e := range expectations { 77 _m.ApplyDeleteAdvisoryDetailBucketExpectation(e) 78 } 79 } 80 81 // DeleteAdvisoryDetailBucket provides a mock function with given fields: 82 func (_m *MockDB) DeleteAdvisoryDetailBucket() error { 83 ret := _m.Called() 84 85 var r0 error 86 if rf, ok := ret.Get(0).(func() error); ok { 87 r0 = rf() 88 } else { 89 r0 = ret.Error(0) 90 } 91 92 return r0 93 } 94 95 type DBDeleteVulnerabilityDetailBucketReturns struct { 96 Err error 97 } 98 99 type DBDeleteVulnerabilityDetailBucketExpectation struct { 100 Returns DBDeleteVulnerabilityDetailBucketReturns 101 } 102 103 func (_m *MockDB) ApplyDeleteVulnerabilityDetailBucketExpectation(e DBDeleteVulnerabilityDetailBucketExpectation) { 104 var args []interface{} 105 _m.On("DeleteVulnerabilityDetailBucket", args...).Return(e.Returns.Err) 106 } 107 108 func (_m *MockDB) ApplyDeleteVulnerabilityDetailBucketExpectations(expectations []DBDeleteVulnerabilityDetailBucketExpectation) { 109 for _, e := range expectations { 110 _m.ApplyDeleteVulnerabilityDetailBucketExpectation(e) 111 } 112 } 113 114 // DeleteVulnerabilityDetailBucket provides a mock function with given fields: 115 func (_m *MockDB) DeleteVulnerabilityDetailBucket() error { 116 ret := _m.Called() 117 118 var r0 error 119 if rf, ok := ret.Get(0).(func() error); ok { 120 r0 = rf() 121 } else { 122 r0 = ret.Error(0) 123 } 124 125 return r0 126 } 127 128 type DBForEachAdvisoryArgs struct { 129 Sources []string 130 SourcesAnything bool 131 PkgName string 132 PkgNameAnything bool 133 } 134 135 type DBForEachAdvisoryReturns struct { 136 Value map[string]db.Value 137 Err error 138 } 139 140 type DBForEachAdvisoryExpectation struct { 141 Args DBForEachAdvisoryArgs 142 Returns DBForEachAdvisoryReturns 143 } 144 145 func (_m *MockDB) ApplyForEachAdvisoryExpectation(e DBForEachAdvisoryExpectation) { 146 var args []interface{} 147 if e.Args.SourcesAnything { 148 args = append(args, mock.Anything) 149 } else { 150 args = append(args, e.Args.Sources) 151 } 152 if e.Args.PkgNameAnything { 153 args = append(args, mock.Anything) 154 } else { 155 args = append(args, e.Args.PkgName) 156 } 157 _m.On("ForEachAdvisory", args...).Return(e.Returns.Value, e.Returns.Err) 158 } 159 160 func (_m *MockDB) ApplyForEachAdvisoryExpectations(expectations []DBForEachAdvisoryExpectation) { 161 for _, e := range expectations { 162 _m.ApplyForEachAdvisoryExpectation(e) 163 } 164 } 165 166 // ForEachAdvisory provides a mock function with given fields: sources, pkgName 167 func (_m *MockDB) ForEachAdvisory(sources []string, pkgName string) (map[string]db.Value, error) { 168 ret := _m.Called(sources, pkgName) 169 170 var r0 map[string]db.Value 171 if rf, ok := ret.Get(0).(func([]string, string) map[string]db.Value); ok { 172 r0 = rf(sources, pkgName) 173 } else { 174 if ret.Get(0) != nil { 175 r0 = ret.Get(0).(map[string]db.Value) 176 } 177 } 178 179 var r1 error 180 if rf, ok := ret.Get(1).(func([]string, string) error); ok { 181 r1 = rf(sources, pkgName) 182 } else { 183 r1 = ret.Error(1) 184 } 185 186 return r0, r1 187 } 188 189 type DBForEachVulnerabilityIDArgs struct { 190 Fn func(*bbolt.Tx, string) error 191 FnAnything bool 192 } 193 194 type DBForEachVulnerabilityIDReturns struct { 195 Err error 196 } 197 198 type DBForEachVulnerabilityIDExpectation struct { 199 Args DBForEachVulnerabilityIDArgs 200 Returns DBForEachVulnerabilityIDReturns 201 } 202 203 func (_m *MockDB) ApplyForEachVulnerabilityIDExpectation(e DBForEachVulnerabilityIDExpectation) { 204 var args []interface{} 205 if e.Args.FnAnything { 206 args = append(args, mock.Anything) 207 } else { 208 args = append(args, e.Args.Fn) 209 } 210 _m.On("ForEachVulnerabilityID", args...).Return(e.Returns.Err) 211 } 212 213 func (_m *MockDB) ApplyForEachVulnerabilityIDExpectations(expectations []DBForEachVulnerabilityIDExpectation) { 214 for _, e := range expectations { 215 _m.ApplyForEachVulnerabilityIDExpectation(e) 216 } 217 } 218 219 // ForEachVulnerabilityID provides a mock function with given fields: fn 220 func (_m *MockDB) ForEachVulnerabilityID(fn func(*bbolt.Tx, string) error) error { 221 ret := _m.Called(fn) 222 223 var r0 error 224 if rf, ok := ret.Get(0).(func(func(*bbolt.Tx, string) error) error); ok { 225 r0 = rf(fn) 226 } else { 227 r0 = ret.Error(0) 228 } 229 230 return r0 231 } 232 233 type DBGetArgs struct { 234 Release string 235 ReleaseAnything bool 236 PkgName string 237 PkgNameAnything bool 238 } 239 240 type DBGetReturns struct { 241 _a0 []types.Advisory 242 _a1 error 243 } 244 245 type DBGetExpectation struct { 246 Args DBGetArgs 247 Returns DBGetReturns 248 } 249 250 func (_m *MockDB) ApplyGetExpectation(e DBGetExpectation) { 251 var args []interface{} 252 if e.Args.ReleaseAnything { 253 args = append(args, mock.Anything) 254 } else { 255 args = append(args, e.Args.Release) 256 } 257 if e.Args.PkgNameAnything { 258 args = append(args, mock.Anything) 259 } else { 260 args = append(args, e.Args.PkgName) 261 } 262 _m.On("Get", args...).Return(e.Returns._a0, e.Returns._a1) 263 } 264 265 func (_m *MockDB) ApplyGetExpectations(expectations []DBGetExpectation) { 266 for _, e := range expectations { 267 _m.ApplyGetExpectation(e) 268 } 269 } 270 271 // Get provides a mock function with given fields: release, pkgName 272 func (_m *MockDB) Get(release string, pkgName string) ([]types.Advisory, error) { 273 ret := _m.Called(release, pkgName) 274 275 var r0 []types.Advisory 276 if rf, ok := ret.Get(0).(func(string, string) []types.Advisory); ok { 277 r0 = rf(release, pkgName) 278 } else { 279 if ret.Get(0) != nil { 280 r0 = ret.Get(0).([]types.Advisory) 281 } 282 } 283 284 var r1 error 285 if rf, ok := ret.Get(1).(func(string, string) error); ok { 286 r1 = rf(release, pkgName) 287 } else { 288 r1 = ret.Error(1) 289 } 290 291 return r0, r1 292 } 293 294 type DBGetAdvisoriesArgs struct { 295 Source string 296 SourceAnything bool 297 PkgName string 298 PkgNameAnything bool 299 } 300 301 type DBGetAdvisoriesReturns struct { 302 Advisories []types.Advisory 303 Err error 304 } 305 306 type DBGetAdvisoriesExpectation struct { 307 Args DBGetAdvisoriesArgs 308 Returns DBGetAdvisoriesReturns 309 } 310 311 func (_m *MockDB) ApplyGetAdvisoriesExpectation(e DBGetAdvisoriesExpectation) { 312 var args []interface{} 313 if e.Args.SourceAnything { 314 args = append(args, mock.Anything) 315 } else { 316 args = append(args, e.Args.Source) 317 } 318 if e.Args.PkgNameAnything { 319 args = append(args, mock.Anything) 320 } else { 321 args = append(args, e.Args.PkgName) 322 } 323 _m.On("GetAdvisories", args...).Return(e.Returns.Advisories, e.Returns.Err) 324 } 325 326 func (_m *MockDB) ApplyGetAdvisoriesExpectations(expectations []DBGetAdvisoriesExpectation) { 327 for _, e := range expectations { 328 _m.ApplyGetAdvisoriesExpectation(e) 329 } 330 } 331 332 // GetAdvisories provides a mock function with given fields: source, pkgName 333 func (_m *MockDB) GetAdvisories(source string, pkgName string) ([]types.Advisory, error) { 334 ret := _m.Called(source, pkgName) 335 336 var r0 []types.Advisory 337 if rf, ok := ret.Get(0).(func(string, string) []types.Advisory); ok { 338 r0 = rf(source, pkgName) 339 } else { 340 if ret.Get(0) != nil { 341 r0 = ret.Get(0).([]types.Advisory) 342 } 343 } 344 345 var r1 error 346 if rf, ok := ret.Get(1).(func(string, string) error); ok { 347 r1 = rf(source, pkgName) 348 } else { 349 r1 = ret.Error(1) 350 } 351 352 return r0, r1 353 } 354 355 type DBGetVulnerabilityArgs struct { 356 VulnerabilityID string 357 VulnerabilityIDAnything bool 358 } 359 360 type DBGetVulnerabilityReturns struct { 361 Vulnerability types.Vulnerability 362 Err error 363 } 364 365 type DBGetVulnerabilityExpectation struct { 366 Args DBGetVulnerabilityArgs 367 Returns DBGetVulnerabilityReturns 368 } 369 370 func (_m *MockDB) ApplyGetVulnerabilityExpectation(e DBGetVulnerabilityExpectation) { 371 var args []interface{} 372 if e.Args.VulnerabilityIDAnything { 373 args = append(args, mock.Anything) 374 } else { 375 args = append(args, e.Args.VulnerabilityID) 376 } 377 _m.On("GetVulnerability", args...).Return(e.Returns.Vulnerability, e.Returns.Err) 378 } 379 380 func (_m *MockDB) ApplyGetVulnerabilityExpectations(expectations []DBGetVulnerabilityExpectation) { 381 for _, e := range expectations { 382 _m.ApplyGetVulnerabilityExpectation(e) 383 } 384 } 385 386 // GetVulnerability provides a mock function with given fields: vulnerabilityID 387 func (_m *MockDB) GetVulnerability(vulnerabilityID string) (types.Vulnerability, error) { 388 ret := _m.Called(vulnerabilityID) 389 390 var r0 types.Vulnerability 391 if rf, ok := ret.Get(0).(func(string) types.Vulnerability); ok { 392 r0 = rf(vulnerabilityID) 393 } else { 394 r0 = ret.Get(0).(types.Vulnerability) 395 } 396 397 var r1 error 398 if rf, ok := ret.Get(1).(func(string) error); ok { 399 r1 = rf(vulnerabilityID) 400 } else { 401 r1 = ret.Error(1) 402 } 403 404 return r0, r1 405 } 406 407 type DBGetVulnerabilityDetailArgs struct { 408 CveID string 409 CveIDAnything bool 410 } 411 412 type DBGetVulnerabilityDetailReturns struct { 413 Detail map[types.SourceID]types.VulnerabilityDetail 414 Err error 415 } 416 417 type DBGetVulnerabilityDetailExpectation struct { 418 Args DBGetVulnerabilityDetailArgs 419 Returns DBGetVulnerabilityDetailReturns 420 } 421 422 func (_m *MockDB) ApplyGetVulnerabilityDetailExpectation(e DBGetVulnerabilityDetailExpectation) { 423 var args []interface{} 424 if e.Args.CveIDAnything { 425 args = append(args, mock.Anything) 426 } else { 427 args = append(args, e.Args.CveID) 428 } 429 _m.On("GetVulnerabilityDetail", args...).Return(e.Returns.Detail, e.Returns.Err) 430 } 431 432 func (_m *MockDB) ApplyGetVulnerabilityDetailExpectations(expectations []DBGetVulnerabilityDetailExpectation) { 433 for _, e := range expectations { 434 _m.ApplyGetVulnerabilityDetailExpectation(e) 435 } 436 } 437 438 // GetVulnerabilityDetail provides a mock function with given fields: cveID 439 func (_m *MockDB) GetVulnerabilityDetail(cveID string) (map[types.SourceID]types.VulnerabilityDetail, error) { 440 ret := _m.Called(cveID) 441 442 var r0 map[types.SourceID]types.VulnerabilityDetail 443 if rf, ok := ret.Get(0).(func(string) map[types.SourceID]types.VulnerabilityDetail); ok { 444 r0 = rf(cveID) 445 } else { 446 if ret.Get(0) != nil { 447 r0 = ret.Get(0).(map[types.SourceID]types.VulnerabilityDetail) 448 } 449 } 450 451 var r1 error 452 if rf, ok := ret.Get(1).(func(string) error); ok { 453 r1 = rf(cveID) 454 } else { 455 r1 = ret.Error(1) 456 } 457 458 return r0, r1 459 } 460 461 type DBPutArgs struct { 462 _a0 *bbolt.Tx 463 _a0Anything bool 464 _a1 PutInput 465 _a1Anything bool 466 } 467 468 type DBPutReturns struct { 469 _a0 error 470 } 471 472 type DBPutExpectation struct { 473 Args DBPutArgs 474 Returns DBPutReturns 475 } 476 477 func (_m *MockDB) ApplyPutExpectation(e DBPutExpectation) { 478 var args []interface{} 479 if e.Args._a0Anything { 480 args = append(args, mock.Anything) 481 } else { 482 args = append(args, e.Args._a0) 483 } 484 if e.Args._a1Anything { 485 args = append(args, mock.Anything) 486 } else { 487 args = append(args, e.Args._a1) 488 } 489 _m.On("Put", args...).Return(e.Returns._a0) 490 } 491 492 func (_m *MockDB) ApplyPutExpectations(expectations []DBPutExpectation) { 493 for _, e := range expectations { 494 _m.ApplyPutExpectation(e) 495 } 496 } 497 498 // Put provides a mock function with given fields: _a0, _a1 499 func (_m *MockDB) Put(_a0 *bbolt.Tx, _a1 PutInput) error { 500 ret := _m.Called(_a0, _a1) 501 502 var r0 error 503 if rf, ok := ret.Get(0).(func(*bbolt.Tx, PutInput) error); ok { 504 r0 = rf(_a0, _a1) 505 } else { 506 r0 = ret.Error(0) 507 } 508 509 return r0 510 } 511 512 type DBPutAdvisoryDetailArgs struct { 513 Tx *bbolt.Tx 514 TxAnything bool 515 VulnerabilityID string 516 VulnerabilityIDAnything bool 517 PkgName string 518 PkgNameAnything bool 519 NestedBktNames []string 520 NestedBktNamesAnything bool 521 Advisory interface{} 522 AdvisoryAnything bool 523 } 524 525 type DBPutAdvisoryDetailReturns struct { 526 Err error 527 } 528 529 type DBPutAdvisoryDetailExpectation struct { 530 Args DBPutAdvisoryDetailArgs 531 Returns DBPutAdvisoryDetailReturns 532 } 533 534 func (_m *MockDB) ApplyPutAdvisoryDetailExpectation(e DBPutAdvisoryDetailExpectation) { 535 var args []interface{} 536 if e.Args.TxAnything { 537 args = append(args, mock.Anything) 538 } else { 539 args = append(args, e.Args.Tx) 540 } 541 if e.Args.VulnerabilityIDAnything { 542 args = append(args, mock.Anything) 543 } else { 544 args = append(args, e.Args.VulnerabilityID) 545 } 546 if e.Args.PkgNameAnything { 547 args = append(args, mock.Anything) 548 } else { 549 args = append(args, e.Args.PkgName) 550 } 551 if e.Args.NestedBktNamesAnything { 552 args = append(args, mock.Anything) 553 } else { 554 args = append(args, e.Args.NestedBktNames) 555 } 556 if e.Args.AdvisoryAnything { 557 args = append(args, mock.Anything) 558 } else { 559 args = append(args, e.Args.Advisory) 560 } 561 _m.On("PutAdvisoryDetail", args...).Return(e.Returns.Err) 562 } 563 564 func (_m *MockDB) ApplyPutAdvisoryDetailExpectations(expectations []DBPutAdvisoryDetailExpectation) { 565 for _, e := range expectations { 566 _m.ApplyPutAdvisoryDetailExpectation(e) 567 } 568 } 569 570 // PutAdvisoryDetail provides a mock function with given fields: tx, vulnerabilityID, pkgName, nestedBktNames, advisory 571 func (_m *MockDB) PutAdvisoryDetail(tx *bbolt.Tx, vulnerabilityID string, pkgName string, nestedBktNames []string, advisory interface{}) error { 572 ret := _m.Called(tx, vulnerabilityID, pkgName, nestedBktNames, advisory) 573 574 var r0 error 575 if rf, ok := ret.Get(0).(func(*bbolt.Tx, string, string, []string, interface{}) error); ok { 576 r0 = rf(tx, vulnerabilityID, pkgName, nestedBktNames, advisory) 577 } else { 578 r0 = ret.Error(0) 579 } 580 581 return r0 582 } 583 584 type DBPutDataSourceArgs struct { 585 Tx *bbolt.Tx 586 TxAnything bool 587 BktName string 588 BktNameAnything bool 589 Source types.DataSource 590 SourceAnything bool 591 } 592 593 type DBPutDataSourceReturns struct { 594 Err error 595 } 596 597 type DBPutDataSourceExpectation struct { 598 Args DBPutDataSourceArgs 599 Returns DBPutDataSourceReturns 600 } 601 602 func (_m *MockDB) ApplyPutDataSourceExpectation(e DBPutDataSourceExpectation) { 603 var args []interface{} 604 if e.Args.TxAnything { 605 args = append(args, mock.Anything) 606 } else { 607 args = append(args, e.Args.Tx) 608 } 609 if e.Args.BktNameAnything { 610 args = append(args, mock.Anything) 611 } else { 612 args = append(args, e.Args.BktName) 613 } 614 if e.Args.SourceAnything { 615 args = append(args, mock.Anything) 616 } else { 617 args = append(args, e.Args.Source) 618 } 619 _m.On("PutDataSource", args...).Return(e.Returns.Err) 620 } 621 622 func (_m *MockDB) ApplyPutDataSourceExpectations(expectations []DBPutDataSourceExpectation) { 623 for _, e := range expectations { 624 _m.ApplyPutDataSourceExpectation(e) 625 } 626 } 627 628 // PutDataSource provides a mock function with given fields: tx, bktName, source 629 func (_m *MockDB) PutDataSource(tx *bbolt.Tx, bktName string, source types.DataSource) error { 630 ret := _m.Called(tx, bktName, source) 631 632 var r0 error 633 if rf, ok := ret.Get(0).(func(*bbolt.Tx, string, types.DataSource) error); ok { 634 r0 = rf(tx, bktName, source) 635 } else { 636 r0 = ret.Error(0) 637 } 638 639 return r0 640 } 641 642 type DBPutRedHatCPEsArgs struct { 643 Tx *bbolt.Tx 644 TxAnything bool 645 CpeIndex int 646 CpeIndexAnything bool 647 Cpe string 648 CpeAnything bool 649 } 650 651 type DBPutRedHatCPEsReturns struct { 652 Err error 653 } 654 655 type DBPutRedHatCPEsExpectation struct { 656 Args DBPutRedHatCPEsArgs 657 Returns DBPutRedHatCPEsReturns 658 } 659 660 func (_m *MockDB) ApplyPutRedHatCPEsExpectation(e DBPutRedHatCPEsExpectation) { 661 var args []interface{} 662 if e.Args.TxAnything { 663 args = append(args, mock.Anything) 664 } else { 665 args = append(args, e.Args.Tx) 666 } 667 if e.Args.CpeIndexAnything { 668 args = append(args, mock.Anything) 669 } else { 670 args = append(args, e.Args.CpeIndex) 671 } 672 if e.Args.CpeAnything { 673 args = append(args, mock.Anything) 674 } else { 675 args = append(args, e.Args.Cpe) 676 } 677 _m.On("PutRedHatCPEs", args...).Return(e.Returns.Err) 678 } 679 680 func (_m *MockDB) ApplyPutRedHatCPEsExpectations(expectations []DBPutRedHatCPEsExpectation) { 681 for _, e := range expectations { 682 _m.ApplyPutRedHatCPEsExpectation(e) 683 } 684 } 685 686 // PutRedHatCPEs provides a mock function with given fields: tx, cpeIndex, cpe 687 func (_m *MockDB) PutRedHatCPEs(tx *bbolt.Tx, cpeIndex int, cpe string) error { 688 ret := _m.Called(tx, cpeIndex, cpe) 689 690 var r0 error 691 if rf, ok := ret.Get(0).(func(*bbolt.Tx, int, string) error); ok { 692 r0 = rf(tx, cpeIndex, cpe) 693 } else { 694 r0 = ret.Error(0) 695 } 696 697 return r0 698 } 699 700 type DBPutRedHatNVRsArgs struct { 701 Tx *bbolt.Tx 702 TxAnything bool 703 Nvr string 704 NvrAnything bool 705 CpeIndices []int 706 CpeIndicesAnything bool 707 } 708 709 type DBPutRedHatNVRsReturns struct { 710 Err error 711 } 712 713 type DBPutRedHatNVRsExpectation struct { 714 Args DBPutRedHatNVRsArgs 715 Returns DBPutRedHatNVRsReturns 716 } 717 718 func (_m *MockDB) ApplyPutRedHatNVRsExpectation(e DBPutRedHatNVRsExpectation) { 719 var args []interface{} 720 if e.Args.TxAnything { 721 args = append(args, mock.Anything) 722 } else { 723 args = append(args, e.Args.Tx) 724 } 725 if e.Args.NvrAnything { 726 args = append(args, mock.Anything) 727 } else { 728 args = append(args, e.Args.Nvr) 729 } 730 if e.Args.CpeIndicesAnything { 731 args = append(args, mock.Anything) 732 } else { 733 args = append(args, e.Args.CpeIndices) 734 } 735 _m.On("PutRedHatNVRs", args...).Return(e.Returns.Err) 736 } 737 738 func (_m *MockDB) ApplyPutRedHatNVRsExpectations(expectations []DBPutRedHatNVRsExpectation) { 739 for _, e := range expectations { 740 _m.ApplyPutRedHatNVRsExpectation(e) 741 } 742 } 743 744 // PutRedHatNVRs provides a mock function with given fields: tx, nvr, cpeIndices 745 func (_m *MockDB) PutRedHatNVRs(tx *bbolt.Tx, nvr string, cpeIndices []int) error { 746 ret := _m.Called(tx, nvr, cpeIndices) 747 748 var r0 error 749 if rf, ok := ret.Get(0).(func(*bbolt.Tx, string, []int) error); ok { 750 r0 = rf(tx, nvr, cpeIndices) 751 } else { 752 r0 = ret.Error(0) 753 } 754 755 return r0 756 } 757 758 type DBPutRedHatRepositoriesArgs struct { 759 Tx *bbolt.Tx 760 TxAnything bool 761 Repository string 762 RepositoryAnything bool 763 CpeIndices []int 764 CpeIndicesAnything bool 765 } 766 767 type DBPutRedHatRepositoriesReturns struct { 768 Err error 769 } 770 771 type DBPutRedHatRepositoriesExpectation struct { 772 Args DBPutRedHatRepositoriesArgs 773 Returns DBPutRedHatRepositoriesReturns 774 } 775 776 func (_m *MockDB) ApplyPutRedHatRepositoriesExpectation(e DBPutRedHatRepositoriesExpectation) { 777 var args []interface{} 778 if e.Args.TxAnything { 779 args = append(args, mock.Anything) 780 } else { 781 args = append(args, e.Args.Tx) 782 } 783 if e.Args.RepositoryAnything { 784 args = append(args, mock.Anything) 785 } else { 786 args = append(args, e.Args.Repository) 787 } 788 if e.Args.CpeIndicesAnything { 789 args = append(args, mock.Anything) 790 } else { 791 args = append(args, e.Args.CpeIndices) 792 } 793 _m.On("PutRedHatRepositories", args...).Return(e.Returns.Err) 794 } 795 796 func (_m *MockDB) ApplyPutRedHatRepositoriesExpectations(expectations []DBPutRedHatRepositoriesExpectation) { 797 for _, e := range expectations { 798 _m.ApplyPutRedHatRepositoriesExpectation(e) 799 } 800 } 801 802 // PutRedHatRepositories provides a mock function with given fields: tx, repository, cpeIndices 803 func (_m *MockDB) PutRedHatRepositories(tx *bbolt.Tx, repository string, cpeIndices []int) error { 804 ret := _m.Called(tx, repository, cpeIndices) 805 806 var r0 error 807 if rf, ok := ret.Get(0).(func(*bbolt.Tx, string, []int) error); ok { 808 r0 = rf(tx, repository, cpeIndices) 809 } else { 810 r0 = ret.Error(0) 811 } 812 813 return r0 814 } 815 816 type DBPutVulnerabilityArgs struct { 817 Tx *bbolt.Tx 818 TxAnything bool 819 VulnerabilityID string 820 VulnerabilityIDAnything bool 821 Vulnerability types.Vulnerability 822 VulnerabilityAnything bool 823 } 824 825 type DBPutVulnerabilityReturns struct { 826 Err error 827 } 828 829 type DBPutVulnerabilityExpectation struct { 830 Args DBPutVulnerabilityArgs 831 Returns DBPutVulnerabilityReturns 832 } 833 834 func (_m *MockDB) ApplyPutVulnerabilityExpectation(e DBPutVulnerabilityExpectation) { 835 var args []interface{} 836 if e.Args.TxAnything { 837 args = append(args, mock.Anything) 838 } else { 839 args = append(args, e.Args.Tx) 840 } 841 if e.Args.VulnerabilityIDAnything { 842 args = append(args, mock.Anything) 843 } else { 844 args = append(args, e.Args.VulnerabilityID) 845 } 846 if e.Args.VulnerabilityAnything { 847 args = append(args, mock.Anything) 848 } else { 849 args = append(args, e.Args.Vulnerability) 850 } 851 _m.On("PutVulnerability", args...).Return(e.Returns.Err) 852 } 853 854 func (_m *MockDB) ApplyPutVulnerabilityExpectations(expectations []DBPutVulnerabilityExpectation) { 855 for _, e := range expectations { 856 _m.ApplyPutVulnerabilityExpectation(e) 857 } 858 } 859 860 // PutVulnerability provides a mock function with given fields: tx, vulnerabilityID, vulnerability 861 func (_m *MockDB) PutVulnerability(tx *bbolt.Tx, vulnerabilityID string, vulnerability types.Vulnerability) error { 862 ret := _m.Called(tx, vulnerabilityID, vulnerability) 863 864 var r0 error 865 if rf, ok := ret.Get(0).(func(*bbolt.Tx, string, types.Vulnerability) error); ok { 866 r0 = rf(tx, vulnerabilityID, vulnerability) 867 } else { 868 r0 = ret.Error(0) 869 } 870 871 return r0 872 } 873 874 type DBPutVulnerabilityDetailArgs struct { 875 Tx *bbolt.Tx 876 TxAnything bool 877 VulnerabilityID string 878 VulnerabilityIDAnything bool 879 Source types.SourceID 880 SourceAnything bool 881 Vulnerability types.VulnerabilityDetail 882 VulnerabilityAnything bool 883 } 884 885 type DBPutVulnerabilityDetailReturns struct { 886 Err error 887 } 888 889 type DBPutVulnerabilityDetailExpectation struct { 890 Args DBPutVulnerabilityDetailArgs 891 Returns DBPutVulnerabilityDetailReturns 892 } 893 894 func (_m *MockDB) ApplyPutVulnerabilityDetailExpectation(e DBPutVulnerabilityDetailExpectation) { 895 var args []interface{} 896 if e.Args.TxAnything { 897 args = append(args, mock.Anything) 898 } else { 899 args = append(args, e.Args.Tx) 900 } 901 if e.Args.VulnerabilityIDAnything { 902 args = append(args, mock.Anything) 903 } else { 904 args = append(args, e.Args.VulnerabilityID) 905 } 906 if e.Args.SourceAnything { 907 args = append(args, mock.Anything) 908 } else { 909 args = append(args, e.Args.Source) 910 } 911 if e.Args.VulnerabilityAnything { 912 args = append(args, mock.Anything) 913 } else { 914 args = append(args, e.Args.Vulnerability) 915 } 916 _m.On("PutVulnerabilityDetail", args...).Return(e.Returns.Err) 917 } 918 919 func (_m *MockDB) ApplyPutVulnerabilityDetailExpectations(expectations []DBPutVulnerabilityDetailExpectation) { 920 for _, e := range expectations { 921 _m.ApplyPutVulnerabilityDetailExpectation(e) 922 } 923 } 924 925 // PutVulnerabilityDetail provides a mock function with given fields: tx, vulnerabilityID, source, vulnerability 926 func (_m *MockDB) PutVulnerabilityDetail(tx *bbolt.Tx, vulnerabilityID string, source types.SourceID, vulnerability types.VulnerabilityDetail) error { 927 ret := _m.Called(tx, vulnerabilityID, source, vulnerability) 928 929 var r0 error 930 if rf, ok := ret.Get(0).(func(*bbolt.Tx, string, types.SourceID, types.VulnerabilityDetail) error); ok { 931 r0 = rf(tx, vulnerabilityID, source, vulnerability) 932 } else { 933 r0 = ret.Error(0) 934 } 935 936 return r0 937 } 938 939 type DBPutVulnerabilityIDArgs struct { 940 Tx *bbolt.Tx 941 TxAnything bool 942 VulnerabilityID string 943 VulnerabilityIDAnything bool 944 } 945 946 type DBPutVulnerabilityIDReturns struct { 947 Err error 948 } 949 950 type DBPutVulnerabilityIDExpectation struct { 951 Args DBPutVulnerabilityIDArgs 952 Returns DBPutVulnerabilityIDReturns 953 } 954 955 func (_m *MockDB) ApplyPutVulnerabilityIDExpectation(e DBPutVulnerabilityIDExpectation) { 956 var args []interface{} 957 if e.Args.TxAnything { 958 args = append(args, mock.Anything) 959 } else { 960 args = append(args, e.Args.Tx) 961 } 962 if e.Args.VulnerabilityIDAnything { 963 args = append(args, mock.Anything) 964 } else { 965 args = append(args, e.Args.VulnerabilityID) 966 } 967 _m.On("PutVulnerabilityID", args...).Return(e.Returns.Err) 968 } 969 970 func (_m *MockDB) ApplyPutVulnerabilityIDExpectations(expectations []DBPutVulnerabilityIDExpectation) { 971 for _, e := range expectations { 972 _m.ApplyPutVulnerabilityIDExpectation(e) 973 } 974 } 975 976 // PutVulnerabilityID provides a mock function with given fields: tx, vulnerabilityID 977 func (_m *MockDB) PutVulnerabilityID(tx *bbolt.Tx, vulnerabilityID string) error { 978 ret := _m.Called(tx, vulnerabilityID) 979 980 var r0 error 981 if rf, ok := ret.Get(0).(func(*bbolt.Tx, string) error); ok { 982 r0 = rf(tx, vulnerabilityID) 983 } else { 984 r0 = ret.Error(0) 985 } 986 987 return r0 988 } 989 990 type DBRedHatNVRToCPEsArgs struct { 991 Nvr string 992 NvrAnything bool 993 } 994 995 type DBRedHatNVRToCPEsReturns struct { 996 CpeIndices []int 997 Err error 998 } 999 1000 type DBRedHatNVRToCPEsExpectation struct { 1001 Args DBRedHatNVRToCPEsArgs 1002 Returns DBRedHatNVRToCPEsReturns 1003 } 1004 1005 func (_m *MockDB) ApplyRedHatNVRToCPEsExpectation(e DBRedHatNVRToCPEsExpectation) { 1006 var args []interface{} 1007 if e.Args.NvrAnything { 1008 args = append(args, mock.Anything) 1009 } else { 1010 args = append(args, e.Args.Nvr) 1011 } 1012 _m.On("RedHatNVRToCPEs", args...).Return(e.Returns.CpeIndices, e.Returns.Err) 1013 } 1014 1015 func (_m *MockDB) ApplyRedHatNVRToCPEsExpectations(expectations []DBRedHatNVRToCPEsExpectation) { 1016 for _, e := range expectations { 1017 _m.ApplyRedHatNVRToCPEsExpectation(e) 1018 } 1019 } 1020 1021 // RedHatNVRToCPEs provides a mock function with given fields: nvr 1022 func (_m *MockDB) RedHatNVRToCPEs(nvr string) ([]int, error) { 1023 ret := _m.Called(nvr) 1024 1025 var r0 []int 1026 if rf, ok := ret.Get(0).(func(string) []int); ok { 1027 r0 = rf(nvr) 1028 } else { 1029 if ret.Get(0) != nil { 1030 r0 = ret.Get(0).([]int) 1031 } 1032 } 1033 1034 var r1 error 1035 if rf, ok := ret.Get(1).(func(string) error); ok { 1036 r1 = rf(nvr) 1037 } else { 1038 r1 = ret.Error(1) 1039 } 1040 1041 return r0, r1 1042 } 1043 1044 type DBRedHatRepoToCPEsArgs struct { 1045 Repository string 1046 RepositoryAnything bool 1047 } 1048 1049 type DBRedHatRepoToCPEsReturns struct { 1050 CpeIndices []int 1051 Err error 1052 } 1053 1054 type DBRedHatRepoToCPEsExpectation struct { 1055 Args DBRedHatRepoToCPEsArgs 1056 Returns DBRedHatRepoToCPEsReturns 1057 } 1058 1059 func (_m *MockDB) ApplyRedHatRepoToCPEsExpectation(e DBRedHatRepoToCPEsExpectation) { 1060 var args []interface{} 1061 if e.Args.RepositoryAnything { 1062 args = append(args, mock.Anything) 1063 } else { 1064 args = append(args, e.Args.Repository) 1065 } 1066 _m.On("RedHatRepoToCPEs", args...).Return(e.Returns.CpeIndices, e.Returns.Err) 1067 } 1068 1069 func (_m *MockDB) ApplyRedHatRepoToCPEsExpectations(expectations []DBRedHatRepoToCPEsExpectation) { 1070 for _, e := range expectations { 1071 _m.ApplyRedHatRepoToCPEsExpectation(e) 1072 } 1073 } 1074 1075 // RedHatRepoToCPEs provides a mock function with given fields: repository 1076 func (_m *MockDB) RedHatRepoToCPEs(repository string) ([]int, error) { 1077 ret := _m.Called(repository) 1078 1079 var r0 []int 1080 if rf, ok := ret.Get(0).(func(string) []int); ok { 1081 r0 = rf(repository) 1082 } else { 1083 if ret.Get(0) != nil { 1084 r0 = ret.Get(0).([]int) 1085 } 1086 } 1087 1088 var r1 error 1089 if rf, ok := ret.Get(1).(func(string) error); ok { 1090 r1 = rf(repository) 1091 } else { 1092 r1 = ret.Error(1) 1093 } 1094 1095 return r0, r1 1096 } 1097 1098 type DBSaveAdvisoryDetailsArgs struct { 1099 Tx *bbolt.Tx 1100 TxAnything bool 1101 CveID string 1102 CveIDAnything bool 1103 } 1104 1105 type DBSaveAdvisoryDetailsReturns struct { 1106 Err error 1107 } 1108 1109 type DBSaveAdvisoryDetailsExpectation struct { 1110 Args DBSaveAdvisoryDetailsArgs 1111 Returns DBSaveAdvisoryDetailsReturns 1112 } 1113 1114 func (_m *MockDB) ApplySaveAdvisoryDetailsExpectation(e DBSaveAdvisoryDetailsExpectation) { 1115 var args []interface{} 1116 if e.Args.TxAnything { 1117 args = append(args, mock.Anything) 1118 } else { 1119 args = append(args, e.Args.Tx) 1120 } 1121 if e.Args.CveIDAnything { 1122 args = append(args, mock.Anything) 1123 } else { 1124 args = append(args, e.Args.CveID) 1125 } 1126 _m.On("SaveAdvisoryDetails", args...).Return(e.Returns.Err) 1127 } 1128 1129 func (_m *MockDB) ApplySaveAdvisoryDetailsExpectations(expectations []DBSaveAdvisoryDetailsExpectation) { 1130 for _, e := range expectations { 1131 _m.ApplySaveAdvisoryDetailsExpectation(e) 1132 } 1133 } 1134 1135 // SaveAdvisoryDetails provides a mock function with given fields: tx, cveID 1136 func (_m *MockDB) SaveAdvisoryDetails(tx *bbolt.Tx, cveID string) error { 1137 ret := _m.Called(tx, cveID) 1138 1139 var r0 error 1140 if rf, ok := ret.Get(0).(func(*bbolt.Tx, string) error); ok { 1141 r0 = rf(tx, cveID) 1142 } else { 1143 r0 = ret.Error(0) 1144 } 1145 1146 return r0 1147 }