fleet/server/mock/service_osquery.go
Zach Wasserman deaf8880f3
Expose live query error messages via API (#205)
Somewhere around osquery 4.4.0 these messages were added to query
responses. We can now expose them to the API clients rather than using
the placeholder text.

Required for #192
2021-01-19 14:52:29 -08:00

85 lines
3.2 KiB
Go

// Automatically generated by mockimpl. DO NOT EDIT!
package mock
import (
"context"
"encoding/json"
"github.com/fleetdm/fleet/server/kolide"
)
var _ kolide.OsqueryService = (*TLSService)(nil)
type EnrollAgentFunc func(ctx context.Context, enrollSecret string, hostIdentifier string, hostDetails map[string](map[string]string)) (nodeKey string, err error)
type AuthenticateHostFuncI func(ctx context.Context, nodeKey string) (host *kolide.Host, err error)
type GetClientConfigFunc func(ctx context.Context) (config map[string]interface{}, err error)
type GetDistributedQueriesFunc func(ctx context.Context) (queries map[string]string, accelerate uint, err error)
type SubmitDistributedQueryResultsFunc func(ctx context.Context, results kolide.OsqueryDistributedQueryResults, statuses map[string]kolide.OsqueryStatus, messages map[string]string) (err error)
type SubmitStatusLogsFunc func(ctx context.Context, logs []json.RawMessage) (err error)
type SubmitResultLogsFunc func(ctx context.Context, logs []json.RawMessage) (err error)
type TLSService struct {
EnrollAgentFunc EnrollAgentFunc
EnrollAgentFuncInvoked bool
AuthenticateHostFunc AuthenticateHostFuncI
AuthenticateHostFuncInvoked bool
GetClientConfigFunc GetClientConfigFunc
GetClientConfigFuncInvoked bool
GetDistributedQueriesFunc GetDistributedQueriesFunc
GetDistributedQueriesFuncInvoked bool
SubmitDistributedQueryResultsFunc SubmitDistributedQueryResultsFunc
SubmitDistributedQueryResultsFuncInvoked bool
SubmitStatusLogsFunc SubmitStatusLogsFunc
SubmitStatusLogsFuncInvoked bool
SubmitResultLogsFunc SubmitResultLogsFunc
SubmitResultLogsFuncInvoked bool
}
func (s *TLSService) EnrollAgent(ctx context.Context, enrollSecret string, hostIdentifier string, hostDetails map[string](map[string]string)) (nodeKey string, err error) {
s.EnrollAgentFuncInvoked = true
return s.EnrollAgentFunc(ctx, enrollSecret, hostIdentifier, hostDetails)
}
func (s *TLSService) AuthenticateHost(ctx context.Context, nodeKey string) (host *kolide.Host, err error) {
s.AuthenticateHostFuncInvoked = true
return s.AuthenticateHostFunc(ctx, nodeKey)
}
func (s *TLSService) GetClientConfig(ctx context.Context) (config map[string]interface{}, err error) {
s.GetClientConfigFuncInvoked = true
return s.GetClientConfigFunc(ctx)
}
func (s *TLSService) GetDistributedQueries(ctx context.Context) (queries map[string]string, accelerate uint, err error) {
s.GetDistributedQueriesFuncInvoked = true
return s.GetDistributedQueriesFunc(ctx)
}
func (s *TLSService) SubmitDistributedQueryResults(ctx context.Context, results kolide.OsqueryDistributedQueryResults, statuses map[string]kolide.OsqueryStatus, messages map[string]string) (err error) {
s.SubmitDistributedQueryResultsFuncInvoked = true
return s.SubmitDistributedQueryResultsFunc(ctx, results, statuses, messages)
}
func (s *TLSService) SubmitStatusLogs(ctx context.Context, logs []json.RawMessage) (err error) {
s.SubmitStatusLogsFuncInvoked = true
return s.SubmitStatusLogsFunc(ctx, logs)
}
func (s *TLSService) SubmitResultLogs(ctx context.Context, logs []json.RawMessage) (err error) {
s.SubmitResultLogsFuncInvoked = true
return s.SubmitResultLogsFunc(ctx, logs)
}