fleet/server/mock/datastore_teams.go
Tomas Touceda f8b7a83cc6
Process stored CPEs and store found CVEs (#1533)
* WIP

* WIP

* Make path optional and fix tests

* Add first generate

* Move to nvd package

* remove replace

* Re-add replace

* It's path, not file name

* Change how db path is set and use etag

* Fix typos

* Make db generation faster

* Remove quotes

* Doesn't like comments

* Samitize etag and save to file

* Refactor some things and improve writing of etagenv

* Compress file and truncate amount of items for faster testing

* Remove quotes

* Try to improve performance

* Ignore truncate error if not exists

* Minor cleanup and make sqlite have cpe prefix

* Simplify code and test sync

* Add VCR for sync test

* Check for nvdRelease nil

* Add test for the actual translation

* Address review comments

* Rename generate command because we'll have a cve one too

* Move to its own dir

* Add first cve db generation

* WIP but with final strategy, preparring to merge main

* Fix merge conflicts

* WIP

* wip

* Insert CVEs to the db

* Remove unused code

* Use wg instead of counting

* Call cancelFunc to avoid ctx leak

* Fix logs for better readability

* Point code to fleetdm instead of my repo
2021-08-04 18:01:39 -03:00

90 lines
2.4 KiB
Go

// Automatically generated by mockimpl. DO NOT EDIT!
package mock
import "github.com/fleetdm/fleet/v4/server/fleet"
var _ fleet.TeamStore = (*TeamStore)(nil)
type NewTeamFunc func(team *fleet.Team) (*fleet.Team, error)
type SaveTeamFunc func(team *fleet.Team) (*fleet.Team, error)
type TeamFunc func(tid uint) (*fleet.Team, error)
type DeleteTeamFunc func(tid uint) error
type TeamByNameFunc func(name string) (*fleet.Team, error)
type ListTeamsFunc func(filter fleet.TeamFilter, opt fleet.ListOptions) ([]*fleet.Team, error)
type SearchTeamsFunc func(filter fleet.TeamFilter, matchQuery string, omit ...uint) ([]*fleet.Team, error)
type TeamEnrollSecretsFunc func(teamID uint) ([]*fleet.EnrollSecret, error)
type TeamStore struct {
NewTeamFunc NewTeamFunc
NewTeamFuncInvoked bool
SaveTeamFunc SaveTeamFunc
SaveTeamFuncInvoked bool
TeamFunc TeamFunc
TeamFuncInvoked bool
DeleteTeamFunc DeleteTeamFunc
DeleteTeamFuncInvoked bool
TeamByNameFunc TeamByNameFunc
TeamByNameFuncInvoked bool
ListTeamsFunc ListTeamsFunc
ListTeamsFuncInvoked bool
SearchTeamsFunc SearchTeamsFunc
SearchTeamsFuncInvoked bool
TeamEnrollSecretsFunc TeamEnrollSecretsFunc
TeamEnrollSecretsFuncInvoked bool
}
func (s *TeamStore) NewTeam(team *fleet.Team) (*fleet.Team, error) {
s.NewTeamFuncInvoked = true
return s.NewTeamFunc(team)
}
func (s *TeamStore) SaveTeam(team *fleet.Team) (*fleet.Team, error) {
s.SaveTeamFuncInvoked = true
return s.SaveTeamFunc(team)
}
func (s *TeamStore) Team(tid uint) (*fleet.Team, error) {
s.TeamFuncInvoked = true
return s.TeamFunc(tid)
}
func (s *TeamStore) DeleteTeam(tid uint) error {
s.DeleteTeamFuncInvoked = true
return s.DeleteTeamFunc(tid)
}
func (s *TeamStore) TeamByName(name string) (*fleet.Team, error) {
s.TeamByNameFuncInvoked = true
return s.TeamByNameFunc(name)
}
func (s *TeamStore) ListTeams(filter fleet.TeamFilter, opt fleet.ListOptions) ([]*fleet.Team, error) {
s.ListTeamsFuncInvoked = true
return s.ListTeamsFunc(filter, opt)
}
func (s *TeamStore) SearchTeams(filter fleet.TeamFilter, matchQuery string, omit ...uint) ([]*fleet.Team, error) {
s.SearchTeamsFuncInvoked = true
return s.SearchTeamsFunc(filter, matchQuery, omit...)
}
func (s *TeamStore) TeamEnrollSecrets(teamID uint) ([]*fleet.EnrollSecret, error) {
s.TeamEnrollSecretsFuncInvoked = true
return s.TeamEnrollSecretsFunc(teamID)
}