github.com/Uptycs/basequery-go@v0.8.0/mock/osquery.go (about) 1 // Code generated by mockimpl. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 "context" 7 8 "github.com/Uptycs/basequery-go/gen/osquery" 9 ) 10 11 var _ osquery.ExtensionManager = (*ExtensionManager)(nil) 12 13 type CloseFunc func() 14 15 type PingFunc func(ctx context.Context) (*osquery.ExtensionStatus, error) 16 17 type CallFunc func(ctx context.Context, registry string, item string, req osquery.ExtensionPluginRequest) (*osquery.ExtensionResponse, error) 18 19 type ShutdownFunc func(ctx context.Context) error 20 21 type ExtensionsFunc func(ctx context.Context) (osquery.InternalExtensionList, error) 22 23 type RegisterExtensionFunc func(ctx context.Context, info *osquery.InternalExtensionInfo, registry osquery.ExtensionRegistry) (*osquery.ExtensionStatus, error) 24 25 type DeregisterExtensionFunc func(ctx context.Context, uuid osquery.ExtensionRouteUUID) (*osquery.ExtensionStatus, error) 26 27 type OptionsFunc func(ctx context.Context) (osquery.InternalOptionList, error) 28 29 type QueryFunc func(ctx context.Context, sql string) (*osquery.ExtensionResponse, error) 30 31 type GetQueryColumnsFunc func(ctx context.Context, sql string) (*osquery.ExtensionResponse, error) 32 33 type StreamEventsFunc func(ctx context.Context, name string, events osquery.ExtensionPluginResponse) (*osquery.ExtensionStatus, error) 34 35 type GetNodeKeyFunc func(ctx context.Context) (string, error) 36 37 type ExtensionManager struct { 38 CloseFunc CloseFunc 39 CloseFuncInvoked bool 40 41 PingFunc PingFunc 42 PingFuncInvoked bool 43 44 CallFunc CallFunc 45 CallFuncInvoked bool 46 47 ShutdownFunc ShutdownFunc 48 ShutdownFuncInvoked bool 49 50 ExtensionsFunc ExtensionsFunc 51 ExtensionsFuncInvoked bool 52 53 RegisterExtensionFunc RegisterExtensionFunc 54 RegisterExtensionFuncInvoked bool 55 56 DeregisterExtensionFunc DeregisterExtensionFunc 57 DeregisterExtensionFuncInvoked bool 58 59 OptionsFunc OptionsFunc 60 OptionsFuncInvoked bool 61 62 QueryFunc QueryFunc 63 QueryFuncInvoked bool 64 65 GetQueryColumnsFunc GetQueryColumnsFunc 66 GetQueryColumnsFuncInvoked bool 67 68 StreamEventsFunc StreamEventsFunc 69 StreamEventsFuncInvoked bool 70 71 GetNodeKeyFunc GetNodeKeyFunc 72 GetNodeKeyFuncInvoked bool 73 } 74 75 func (m *ExtensionManager) Close() { 76 m.CloseFuncInvoked = true 77 m.CloseFunc() 78 } 79 80 func (m *ExtensionManager) Ping(ctx context.Context) (*osquery.ExtensionStatus, error) { 81 m.PingFuncInvoked = true 82 return m.PingFunc(ctx) 83 } 84 85 func (m *ExtensionManager) Call(ctx context.Context, registry string, item string, req osquery.ExtensionPluginRequest) (*osquery.ExtensionResponse, error) { 86 m.CallFuncInvoked = true 87 return m.CallFunc(ctx, registry, item, req) 88 } 89 90 func (m *ExtensionManager) Shutdown(ctx context.Context) error { 91 m.ShutdownFuncInvoked = true 92 return m.ShutdownFunc(ctx) 93 } 94 95 func (m *ExtensionManager) Extensions(ctx context.Context) (osquery.InternalExtensionList, error) { 96 m.ExtensionsFuncInvoked = true 97 return m.ExtensionsFunc(ctx) 98 } 99 100 func (m *ExtensionManager) RegisterExtension(ctx context.Context, info *osquery.InternalExtensionInfo, registry osquery.ExtensionRegistry) (*osquery.ExtensionStatus, error) { 101 m.RegisterExtensionFuncInvoked = true 102 return m.RegisterExtensionFunc(ctx, info, registry) 103 } 104 105 func (m *ExtensionManager) DeregisterExtension(ctx context.Context, uuid osquery.ExtensionRouteUUID) (*osquery.ExtensionStatus, error) { 106 m.DeregisterExtensionFuncInvoked = true 107 return m.DeregisterExtensionFunc(ctx, uuid) 108 } 109 110 func (m *ExtensionManager) Options(ctx context.Context) (osquery.InternalOptionList, error) { 111 m.OptionsFuncInvoked = true 112 return m.OptionsFunc(ctx) 113 } 114 115 func (m *ExtensionManager) Query(ctx context.Context, sql string) (*osquery.ExtensionResponse, error) { 116 m.QueryFuncInvoked = true 117 return m.QueryFunc(ctx, sql) 118 } 119 120 func (m *ExtensionManager) GetQueryColumns(ctx context.Context, sql string) (*osquery.ExtensionResponse, error) { 121 m.GetQueryColumnsFuncInvoked = true 122 return m.GetQueryColumnsFunc(ctx, sql) 123 } 124 125 func (m *ExtensionManager) StreamEvents(ctx context.Context, name string, events osquery.ExtensionPluginResponse) (*osquery.ExtensionStatus, error) { 126 m.StreamEventsFuncInvoked = true 127 return m.StreamEventsFunc(ctx, name, events) 128 } 129 130 func (m *ExtensionManager) GetNodeKey(ctx context.Context) (string, error) { 131 m.GetNodeKeyFuncInvoked = true 132 return m.GetNodeKeyFunc(ctx) 133 }