mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Replaces (and appropriately refactors) a number of endpoints that were removed long ago when we decided to kill the UI with the fleetctl release. We turned out not to do this, and now need to restore these missing endpoints. This is not a straight up replacement of the existing code because of refactoring to the DB schemas that was also done in the migration. Most of the replaced code was removed in #1670 and #1686. Fixes #1811, fixes #1810
179 lines
5.1 KiB
Go
179 lines
5.1 KiB
Go
// Automatically generated by mockimpl. DO NOT EDIT!
|
|
|
|
package mock
|
|
|
|
import "github.com/kolide/fleet/server/kolide"
|
|
|
|
var _ kolide.PackStore = (*PackStore)(nil)
|
|
|
|
type ApplyPackSpecsFunc func(specs []*kolide.PackSpec) error
|
|
|
|
type GetPackSpecsFunc func() ([]*kolide.PackSpec, error)
|
|
|
|
type GetPackSpecFunc func(name string) (*kolide.PackSpec, error)
|
|
|
|
type NewPackFunc func(pack *kolide.Pack, opts ...kolide.OptionalArg) (*kolide.Pack, error)
|
|
|
|
type SavePackFunc func(pack *kolide.Pack) error
|
|
|
|
type DeletePackFunc func(name string) error
|
|
|
|
type PackFunc func(pid uint) (*kolide.Pack, error)
|
|
|
|
type ListPacksFunc func(opt kolide.ListOptions) ([]*kolide.Pack, error)
|
|
|
|
type PackByNameFunc func(name string, opts ...kolide.OptionalArg) (*kolide.Pack, bool, error)
|
|
|
|
type AddLabelToPackFunc func(lid uint, pid uint, opts ...kolide.OptionalArg) error
|
|
|
|
type RemoveLabelFromPackFunc func(lid uint, pid uint) error
|
|
|
|
type ListLabelsForPackFunc func(pid uint) ([]*kolide.Label, error)
|
|
|
|
type AddHostToPackFunc func(hid uint, pid uint) error
|
|
|
|
type RemoveHostFromPackFunc func(hid uint, pid uint) error
|
|
|
|
type ListPacksForHostFunc func(hid uint) (packs []*kolide.Pack, err error)
|
|
|
|
type ListHostsInPackFunc func(pid uint, opt kolide.ListOptions) ([]uint, error)
|
|
|
|
type ListExplicitHostsInPackFunc func(pid uint, opt kolide.ListOptions) ([]uint, error)
|
|
|
|
type PackStore struct {
|
|
ApplyPackSpecsFunc ApplyPackSpecsFunc
|
|
ApplyPackSpecsFuncInvoked bool
|
|
|
|
GetPackSpecsFunc GetPackSpecsFunc
|
|
GetPackSpecsFuncInvoked bool
|
|
|
|
GetPackSpecFunc GetPackSpecFunc
|
|
GetPackSpecFuncInvoked bool
|
|
|
|
NewPackFunc NewPackFunc
|
|
NewPackFuncInvoked bool
|
|
|
|
SavePackFunc SavePackFunc
|
|
SavePackFuncInvoked bool
|
|
|
|
DeletePackFunc DeletePackFunc
|
|
DeletePackFuncInvoked bool
|
|
|
|
PackFunc PackFunc
|
|
PackFuncInvoked bool
|
|
|
|
ListPacksFunc ListPacksFunc
|
|
ListPacksFuncInvoked bool
|
|
|
|
PackByNameFunc PackByNameFunc
|
|
PackByNameFuncInvoked bool
|
|
|
|
AddLabelToPackFunc AddLabelToPackFunc
|
|
AddLabelToPackFuncInvoked bool
|
|
|
|
RemoveLabelFromPackFunc RemoveLabelFromPackFunc
|
|
RemoveLabelFromPackFuncInvoked bool
|
|
|
|
ListLabelsForPackFunc ListLabelsForPackFunc
|
|
ListLabelsForPackFuncInvoked bool
|
|
|
|
AddHostToPackFunc AddHostToPackFunc
|
|
AddHostToPackFuncInvoked bool
|
|
|
|
RemoveHostFromPackFunc RemoveHostFromPackFunc
|
|
RemoveHostFromPackFuncInvoked bool
|
|
|
|
ListPacksForHostFunc ListPacksForHostFunc
|
|
ListPacksForHostFuncInvoked bool
|
|
|
|
ListHostsInPackFunc ListHostsInPackFunc
|
|
ListHostsInPackFuncInvoked bool
|
|
|
|
ListExplicitHostsInPackFunc ListExplicitHostsInPackFunc
|
|
ListExplicitHostsInPackFuncInvoked bool
|
|
}
|
|
|
|
func (s *PackStore) ApplyPackSpecs(specs []*kolide.PackSpec) error {
|
|
s.ApplyPackSpecsFuncInvoked = true
|
|
return s.ApplyPackSpecsFunc(specs)
|
|
}
|
|
|
|
func (s *PackStore) GetPackSpecs() ([]*kolide.PackSpec, error) {
|
|
s.GetPackSpecsFuncInvoked = true
|
|
return s.GetPackSpecsFunc()
|
|
}
|
|
|
|
func (s *PackStore) GetPackSpec(name string) (*kolide.PackSpec, error) {
|
|
s.GetPackSpecFuncInvoked = true
|
|
return s.GetPackSpecFunc(name)
|
|
}
|
|
|
|
func (s *PackStore) NewPack(pack *kolide.Pack, opts ...kolide.OptionalArg) (*kolide.Pack, error) {
|
|
s.NewPackFuncInvoked = true
|
|
return s.NewPackFunc(pack, opts...)
|
|
}
|
|
|
|
func (s *PackStore) SavePack(pack *kolide.Pack) error {
|
|
s.SavePackFuncInvoked = true
|
|
return s.SavePackFunc(pack)
|
|
}
|
|
|
|
func (s *PackStore) DeletePack(name string) error {
|
|
s.DeletePackFuncInvoked = true
|
|
return s.DeletePackFunc(name)
|
|
}
|
|
|
|
func (s *PackStore) Pack(pid uint) (*kolide.Pack, error) {
|
|
s.PackFuncInvoked = true
|
|
return s.PackFunc(pid)
|
|
}
|
|
|
|
func (s *PackStore) ListPacks(opt kolide.ListOptions) ([]*kolide.Pack, error) {
|
|
s.ListPacksFuncInvoked = true
|
|
return s.ListPacksFunc(opt)
|
|
}
|
|
|
|
func (s *PackStore) PackByName(name string, opts ...kolide.OptionalArg) (*kolide.Pack, bool, error) {
|
|
s.PackByNameFuncInvoked = true
|
|
return s.PackByNameFunc(name, opts...)
|
|
}
|
|
|
|
func (s *PackStore) AddLabelToPack(lid uint, pid uint, opts ...kolide.OptionalArg) error {
|
|
s.AddLabelToPackFuncInvoked = true
|
|
return s.AddLabelToPackFunc(lid, pid, opts...)
|
|
}
|
|
|
|
func (s *PackStore) RemoveLabelFromPack(lid uint, pid uint) error {
|
|
s.RemoveLabelFromPackFuncInvoked = true
|
|
return s.RemoveLabelFromPackFunc(lid, pid)
|
|
}
|
|
|
|
func (s *PackStore) ListLabelsForPack(pid uint) ([]*kolide.Label, error) {
|
|
s.ListLabelsForPackFuncInvoked = true
|
|
return s.ListLabelsForPackFunc(pid)
|
|
}
|
|
|
|
func (s *PackStore) AddHostToPack(hid uint, pid uint) error {
|
|
s.AddHostToPackFuncInvoked = true
|
|
return s.AddHostToPackFunc(hid, pid)
|
|
}
|
|
|
|
func (s *PackStore) RemoveHostFromPack(hid uint, pid uint) error {
|
|
s.RemoveHostFromPackFuncInvoked = true
|
|
return s.RemoveHostFromPackFunc(hid, pid)
|
|
}
|
|
|
|
func (s *PackStore) ListPacksForHost(hid uint) (packs []*kolide.Pack, err error) {
|
|
s.ListPacksForHostFuncInvoked = true
|
|
return s.ListPacksForHostFunc(hid)
|
|
}
|
|
|
|
func (s *PackStore) ListHostsInPack(pid uint, opt kolide.ListOptions) ([]uint, error) {
|
|
s.ListHostsInPackFuncInvoked = true
|
|
return s.ListHostsInPackFunc(pid, opt)
|
|
}
|
|
|
|
func (s *PackStore) ListExplicitHostsInPack(pid uint, opt kolide.ListOptions) ([]uint, error) {
|
|
s.ListExplicitHostsInPackFuncInvoked = true
|
|
return s.ListExplicitHostsInPackFunc(pid, opt)
|
|
}
|