-
Notifications
You must be signed in to change notification settings - Fork 79
/
mock_manager.go
99 lines (69 loc) · 2.92 KB
/
mock_manager.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Automatically generated by mockimpl. DO NOT EDIT!
package osquery
import "github.com/osquery/osquery-go/gen/osquery"
var _ ExtensionManager = (*MockExtensionManager)(nil)
type CloseFunc func()
type PingFunc func() (*osquery.ExtensionStatus, error)
type CallFunc func(registry string, item string, req osquery.ExtensionPluginRequest) (*osquery.ExtensionResponse, error)
type ExtensionsFunc func() (osquery.InternalExtensionList, error)
type RegisterExtensionFunc func(info *osquery.InternalExtensionInfo, registry osquery.ExtensionRegistry) (*osquery.ExtensionStatus, error)
type DeregisterExtensionFunc func(uuid osquery.ExtensionRouteUUID) (*osquery.ExtensionStatus, error)
type OptionsFunc func() (osquery.InternalOptionList, error)
type QueryFunc func(sql string) (*osquery.ExtensionResponse, error)
type GetQueryColumnsFunc func(sql string) (*osquery.ExtensionResponse, error)
type MockExtensionManager struct {
CloseFunc CloseFunc
CloseFuncInvoked bool
PingFunc PingFunc
PingFuncInvoked bool
CallFunc CallFunc
CallFuncInvoked bool
ExtensionsFunc ExtensionsFunc
ExtensionsFuncInvoked bool
RegisterExtensionFunc RegisterExtensionFunc
RegisterExtensionFuncInvoked bool
DeRegisterExtensionFunc DeregisterExtensionFunc
DeRegisterExtensionFuncInvoked bool
OptionsFunc OptionsFunc
OptionsFuncInvoked bool
QueryFunc QueryFunc
QueryFuncInvoked bool
GetQueryColumnsFunc GetQueryColumnsFunc
GetQueryColumnsFuncInvoked bool
}
func (m *MockExtensionManager) Close() {
m.CloseFuncInvoked = true
m.CloseFunc()
}
func (m *MockExtensionManager) Ping() (*osquery.ExtensionStatus, error) {
m.PingFuncInvoked = true
return m.PingFunc()
}
func (m *MockExtensionManager) Call(registry string, item string, req osquery.ExtensionPluginRequest) (*osquery.ExtensionResponse, error) {
m.CallFuncInvoked = true
return m.CallFunc(registry, item, req)
}
func (m *MockExtensionManager) Extensions() (osquery.InternalExtensionList, error) {
m.ExtensionsFuncInvoked = true
return m.ExtensionsFunc()
}
func (m *MockExtensionManager) RegisterExtension(info *osquery.InternalExtensionInfo, registry osquery.ExtensionRegistry) (*osquery.ExtensionStatus, error) {
m.RegisterExtensionFuncInvoked = true
return m.RegisterExtensionFunc(info, registry)
}
func (m *MockExtensionManager) DeregisterExtension(uuid osquery.ExtensionRouteUUID) (*osquery.ExtensionStatus, error) {
m.DeRegisterExtensionFuncInvoked = true
return m.DeRegisterExtensionFunc(uuid)
}
func (m *MockExtensionManager) Options() (osquery.InternalOptionList, error) {
m.OptionsFuncInvoked = true
return m.OptionsFunc()
}
func (m *MockExtensionManager) Query(sql string) (*osquery.ExtensionResponse, error) {
m.QueryFuncInvoked = true
return m.QueryFunc(sql)
}
func (m *MockExtensionManager) GetQueryColumns(sql string) (*osquery.ExtensionResponse, error) {
m.GetQueryColumnsFuncInvoked = true
return m.GetQueryColumnsFunc(sql)
}