Documentation
¶
Overview ¶
Package sensetest provides a scriptable fake sensor for testing code that drives sensors (the registry, the runner, the pipeline) without a real host.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Observation ¶
func Observation(key string) evidence.Observation
Observation returns a valid observed `present` observation for tests.
Types ¶
type Fake ¶
type Fake struct {
SensorInfo sense.Info
DetectFn func(context.Context) (bool, error)
CollectFn func(context.Context) (evidence.Batch, error)
}
Fake is a sensor whose behaviour is set by its fields. Nil funcs behave as "present, nothing found".