Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer is a consumer of relative humidities
func NewConsumer ¶
func NewConsumer(sensor RelativeHumiditySensor, handlers ...Handler) *Consumer
NewConsumer returns a new Consumer with the configured handlers
type Handler ¶
type Handler interface { // Handles an individual relative humidity measurement HandleRelativeHumidity(context.Context, *units.RelativeHumidity) error }
Handler defines a handler of relative humidities
type RelativeHumiditySensor ¶
type RelativeHumiditySensor interface { // Run begins reading from the sensor and blocks until either an error occurs or the context is completed Run(context.Context) error // RelativeHumidities returns a channel of relative humidity readings as they become available from the sensor RelativeHumidities() <-chan *units.RelativeHumidity // HumiditySpecs returns a collection of specified measurement ranges supported by the sensor RelativeHumiditySpecs() []*RelativeHumiditySpec }
RelativeHumiditySensor defines a sensor for measuring relative humidity
type RelativeHumiditySpec ¶
type RelativeHumiditySpec struct { // PercentageResolution is a value typically in the range of 0.0 (0%) to 1.0 (100%), though higher values may be feasible depending on conditions PercentageResolution float64 // MinPercentage is a value typically in the range of 0.0 (0%) to 1.0 (100%), though higher values may be feasible depending on conditions MinPercentage float64 // MaxPercentage is a value typically in the range of 0.0 (0%) to 1.0 (100%), though higher values may be feasible depending on conditions MaxPercentage float64 }
RelativeHumiditySpec is a specification of valid measurement ranges supported by the sensor
Click to show internal directories.
Click to hide internal directories.