2017-02-12 04:27:43 +00:00
|
|
|
// Automatically generated by mockimpl. DO NOT EDIT!
|
|
|
|
|
|
|
|
package mock
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2020-11-11 17:59:12 +00:00
|
|
|
"github.com/fleetdm/fleet/server/kolide"
|
2017-02-12 04:27:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var _ kolide.LabelStore = (*LabelStore)(nil)
|
|
|
|
|
2018-01-10 19:38:20 +00:00
|
|
|
type ApplyLabelSpecsFunc func(specs []*kolide.LabelSpec) error
|
|
|
|
|
|
|
|
type GetLabelSpecsFunc func() ([]*kolide.LabelSpec, error)
|
2017-02-12 04:27:43 +00:00
|
|
|
|
2018-05-08 01:54:29 +00:00
|
|
|
type GetLabelSpecFunc func(name string) (*kolide.LabelSpec, error)
|
|
|
|
|
2018-06-18 17:09:08 +00:00
|
|
|
type NewLabelFunc func(Label *kolide.Label, opts ...kolide.OptionalArg) (*kolide.Label, error)
|
|
|
|
|
|
|
|
type SaveLabelFunc func(label *kolide.Label) (*kolide.Label, error)
|
|
|
|
|
2018-05-04 18:05:55 +00:00
|
|
|
type DeleteLabelFunc func(name string) error
|
2017-02-12 04:27:43 +00:00
|
|
|
|
|
|
|
type LabelFunc func(lid uint) (*kolide.Label, error)
|
|
|
|
|
|
|
|
type ListLabelsFunc func(opt kolide.ListOptions) ([]*kolide.Label, error)
|
|
|
|
|
|
|
|
type LabelQueriesForHostFunc func(host *kolide.Host, cutoff time.Time) (map[string]string, error)
|
|
|
|
|
|
|
|
type RecordLabelQueryExecutionsFunc func(host *kolide.Host, results map[uint]bool, t time.Time) error
|
|
|
|
|
|
|
|
type ListLabelsForHostFunc func(hid uint) ([]kolide.Label, error)
|
|
|
|
|
2021-02-18 20:52:43 +00:00
|
|
|
type ListHostsInLabelFunc func(lid uint, opt kolide.HostListOptions) ([]kolide.Host, error)
|
2017-02-12 04:27:43 +00:00
|
|
|
|
|
|
|
type ListUniqueHostsInLabelsFunc func(labels []uint) ([]kolide.Host, error)
|
|
|
|
|
|
|
|
type SearchLabelsFunc func(query string, omit ...uint) ([]kolide.Label, error)
|
|
|
|
|
2018-05-17 22:54:34 +00:00
|
|
|
type LabelIDsByNameFunc func(labels []string) ([]uint, error)
|
|
|
|
|
2017-02-12 04:27:43 +00:00
|
|
|
type LabelStore struct {
|
2018-01-10 19:38:20 +00:00
|
|
|
ApplyLabelSpecsFunc ApplyLabelSpecsFunc
|
|
|
|
ApplyLabelSpecsFuncInvoked bool
|
|
|
|
|
|
|
|
GetLabelSpecsFunc GetLabelSpecsFunc
|
|
|
|
GetLabelSpecsFuncInvoked bool
|
2017-02-12 04:27:43 +00:00
|
|
|
|
2018-05-08 01:54:29 +00:00
|
|
|
GetLabelSpecFunc GetLabelSpecFunc
|
|
|
|
GetLabelSpecFuncInvoked bool
|
|
|
|
|
2018-06-18 17:09:08 +00:00
|
|
|
NewLabelFunc NewLabelFunc
|
|
|
|
NewLabelFuncInvoked bool
|
|
|
|
|
|
|
|
SaveLabelFunc SaveLabelFunc
|
|
|
|
SaveLabelFuncInvoked bool
|
|
|
|
|
2017-02-12 04:27:43 +00:00
|
|
|
DeleteLabelFunc DeleteLabelFunc
|
|
|
|
DeleteLabelFuncInvoked bool
|
|
|
|
|
|
|
|
LabelFunc LabelFunc
|
|
|
|
LabelFuncInvoked bool
|
|
|
|
|
|
|
|
ListLabelsFunc ListLabelsFunc
|
|
|
|
ListLabelsFuncInvoked bool
|
|
|
|
|
|
|
|
LabelQueriesForHostFunc LabelQueriesForHostFunc
|
|
|
|
LabelQueriesForHostFuncInvoked bool
|
|
|
|
|
|
|
|
RecordLabelQueryExecutionsFunc RecordLabelQueryExecutionsFunc
|
|
|
|
RecordLabelQueryExecutionsFuncInvoked bool
|
|
|
|
|
|
|
|
ListLabelsForHostFunc ListLabelsForHostFunc
|
|
|
|
ListLabelsForHostFuncInvoked bool
|
|
|
|
|
|
|
|
ListHostsInLabelFunc ListHostsInLabelFunc
|
|
|
|
ListHostsInLabelFuncInvoked bool
|
|
|
|
|
|
|
|
ListUniqueHostsInLabelsFunc ListUniqueHostsInLabelsFunc
|
|
|
|
ListUniqueHostsInLabelsFuncInvoked bool
|
|
|
|
|
|
|
|
SearchLabelsFunc SearchLabelsFunc
|
|
|
|
SearchLabelsFuncInvoked bool
|
2018-05-17 22:54:34 +00:00
|
|
|
|
|
|
|
LabelIDsByNameFunc LabelIDsByNameFunc
|
|
|
|
LabelIDsByNameFuncInvoked bool
|
2018-01-10 19:38:20 +00:00
|
|
|
}
|
2017-02-12 04:27:43 +00:00
|
|
|
|
2018-01-10 19:38:20 +00:00
|
|
|
func (s *LabelStore) ApplyLabelSpecs(specs []*kolide.LabelSpec) error {
|
|
|
|
s.ApplyLabelSpecsFuncInvoked = true
|
|
|
|
return s.ApplyLabelSpecsFunc(specs)
|
2017-02-12 04:27:43 +00:00
|
|
|
}
|
|
|
|
|
2018-01-10 19:38:20 +00:00
|
|
|
func (s *LabelStore) GetLabelSpecs() ([]*kolide.LabelSpec, error) {
|
|
|
|
s.GetLabelSpecsFuncInvoked = true
|
|
|
|
return s.GetLabelSpecsFunc()
|
2017-02-12 04:27:43 +00:00
|
|
|
}
|
|
|
|
|
2018-05-08 01:54:29 +00:00
|
|
|
func (s *LabelStore) GetLabelSpec(name string) (*kolide.LabelSpec, error) {
|
|
|
|
s.GetLabelSpecFuncInvoked = true
|
|
|
|
return s.GetLabelSpecFunc(name)
|
|
|
|
}
|
|
|
|
|
2018-06-18 17:09:08 +00:00
|
|
|
func (s *LabelStore) NewLabel(Label *kolide.Label, opts ...kolide.OptionalArg) (*kolide.Label, error) {
|
|
|
|
s.NewLabelFuncInvoked = true
|
|
|
|
return s.NewLabelFunc(Label, opts...)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *LabelStore) SaveLabel(label *kolide.Label) (*kolide.Label, error) {
|
|
|
|
s.SaveLabelFuncInvoked = true
|
|
|
|
return s.SaveLabelFunc(label)
|
|
|
|
}
|
|
|
|
|
2018-05-04 18:05:55 +00:00
|
|
|
func (s *LabelStore) DeleteLabel(name string) error {
|
2017-02-12 04:27:43 +00:00
|
|
|
s.DeleteLabelFuncInvoked = true
|
2018-05-04 18:05:55 +00:00
|
|
|
return s.DeleteLabelFunc(name)
|
2017-02-12 04:27:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *LabelStore) Label(lid uint) (*kolide.Label, error) {
|
|
|
|
s.LabelFuncInvoked = true
|
|
|
|
return s.LabelFunc(lid)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *LabelStore) ListLabels(opt kolide.ListOptions) ([]*kolide.Label, error) {
|
|
|
|
s.ListLabelsFuncInvoked = true
|
|
|
|
return s.ListLabelsFunc(opt)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *LabelStore) LabelQueriesForHost(host *kolide.Host, cutoff time.Time) (map[string]string, error) {
|
|
|
|
s.LabelQueriesForHostFuncInvoked = true
|
|
|
|
return s.LabelQueriesForHostFunc(host, cutoff)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *LabelStore) RecordLabelQueryExecutions(host *kolide.Host, results map[uint]bool, t time.Time) error {
|
|
|
|
s.RecordLabelQueryExecutionsFuncInvoked = true
|
|
|
|
return s.RecordLabelQueryExecutionsFunc(host, results, t)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *LabelStore) ListLabelsForHost(hid uint) ([]kolide.Label, error) {
|
|
|
|
s.ListLabelsForHostFuncInvoked = true
|
|
|
|
return s.ListLabelsForHostFunc(hid)
|
|
|
|
}
|
|
|
|
|
2021-02-18 20:52:43 +00:00
|
|
|
func (s *LabelStore) ListHostsInLabel(lid uint, opt kolide.HostListOptions) ([]kolide.Host, error) {
|
2017-02-12 04:27:43 +00:00
|
|
|
s.ListHostsInLabelFuncInvoked = true
|
2020-03-30 02:19:54 +00:00
|
|
|
return s.ListHostsInLabelFunc(lid, opt)
|
2017-02-12 04:27:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *LabelStore) ListUniqueHostsInLabels(labels []uint) ([]kolide.Host, error) {
|
|
|
|
s.ListUniqueHostsInLabelsFuncInvoked = true
|
|
|
|
return s.ListUniqueHostsInLabelsFunc(labels)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *LabelStore) SearchLabels(query string, omit ...uint) ([]kolide.Label, error) {
|
|
|
|
s.SearchLabelsFuncInvoked = true
|
|
|
|
return s.SearchLabelsFunc(query, omit...)
|
|
|
|
}
|
2018-05-17 22:54:34 +00:00
|
|
|
|
|
|
|
func (s *LabelStore) LabelIDsByName(labels []string) ([]uint, error) {
|
|
|
|
s.LabelIDsByNameFuncInvoked = true
|
|
|
|
return s.LabelIDsByNameFunc(labels)
|
|
|
|
}
|