fleet/server/mock/datastore_labels.go
Zach Wasserman c6c5e65a7d
Add support for filtering hosts in label (#335)
Support the same query syntax as the hosts endpoint, here also bounded
by the membership of the label.
2021-02-18 12:52:43 -08:00

164 lines
4.8 KiB
Go

// Automatically generated by mockimpl. DO NOT EDIT!
package mock
import (
"time"
"github.com/fleetdm/fleet/server/kolide"
)
var _ kolide.LabelStore = (*LabelStore)(nil)
type ApplyLabelSpecsFunc func(specs []*kolide.LabelSpec) error
type GetLabelSpecsFunc func() ([]*kolide.LabelSpec, error)
type GetLabelSpecFunc func(name string) (*kolide.LabelSpec, error)
type NewLabelFunc func(Label *kolide.Label, opts ...kolide.OptionalArg) (*kolide.Label, error)
type SaveLabelFunc func(label *kolide.Label) (*kolide.Label, error)
type DeleteLabelFunc func(name string) error
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)
type ListHostsInLabelFunc func(lid uint, opt kolide.HostListOptions) ([]kolide.Host, error)
type ListUniqueHostsInLabelsFunc func(labels []uint) ([]kolide.Host, error)
type SearchLabelsFunc func(query string, omit ...uint) ([]kolide.Label, error)
type LabelIDsByNameFunc func(labels []string) ([]uint, error)
type LabelStore struct {
ApplyLabelSpecsFunc ApplyLabelSpecsFunc
ApplyLabelSpecsFuncInvoked bool
GetLabelSpecsFunc GetLabelSpecsFunc
GetLabelSpecsFuncInvoked bool
GetLabelSpecFunc GetLabelSpecFunc
GetLabelSpecFuncInvoked bool
NewLabelFunc NewLabelFunc
NewLabelFuncInvoked bool
SaveLabelFunc SaveLabelFunc
SaveLabelFuncInvoked bool
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
LabelIDsByNameFunc LabelIDsByNameFunc
LabelIDsByNameFuncInvoked bool
}
func (s *LabelStore) ApplyLabelSpecs(specs []*kolide.LabelSpec) error {
s.ApplyLabelSpecsFuncInvoked = true
return s.ApplyLabelSpecsFunc(specs)
}
func (s *LabelStore) GetLabelSpecs() ([]*kolide.LabelSpec, error) {
s.GetLabelSpecsFuncInvoked = true
return s.GetLabelSpecsFunc()
}
func (s *LabelStore) GetLabelSpec(name string) (*kolide.LabelSpec, error) {
s.GetLabelSpecFuncInvoked = true
return s.GetLabelSpecFunc(name)
}
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)
}
func (s *LabelStore) DeleteLabel(name string) error {
s.DeleteLabelFuncInvoked = true
return s.DeleteLabelFunc(name)
}
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)
}
func (s *LabelStore) ListHostsInLabel(lid uint, opt kolide.HostListOptions) ([]kolide.Host, error) {
s.ListHostsInLabelFuncInvoked = true
return s.ListHostsInLabelFunc(lid, opt)
}
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...)
}
func (s *LabelStore) LabelIDsByName(labels []string) ([]uint, error) {
s.LabelIDsByNameFuncInvoked = true
return s.LabelIDsByNameFunc(labels)
}