Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Concentration ¶
type Concentration struct { // UpperBoundSize is the upper bound of the size of particles included in the concentration UpperBoundSize units.Distance // Amount is the mass concentration of particulate matter in a volume of air Amount units.MassConcentration }
Concentration is a measurement of particulate matter concentrations
type ConcentrationSpec ¶
type ConcentrationSpec struct { // UpperBoundSize is the upper bound of the size of particles included in the concentration UpperBoundSize units.Distance // Resolution is the smallest increment of measurement from the sensor Resolution units.MassConcentration // MinConcentration is the minimum valid measurement from the sensor MinConcentration units.MassConcentration // MaxConcentration is the maximum valid measurement from the sensor MaxConcentration units.MassConcentration }
ConcentrationSpec is a specification of valid measurement ranges supported by the sensor
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer is a consumer of particulate matter concentrations
func NewConsumer ¶
func NewConsumer(sensor ParticulateMatterSensor, handlers ...Handler) *Consumer
NewConsumer returns a new Consumer with the configured handlers
type Handler ¶
type Handler interface { // Handles an individual concentration measurement HandlePMConcentration(context.Context, *Concentration) error }
Handler defines a handler of particulate matter concentrations
type ParticulateMatterSensor ¶
type ParticulateMatterSensor interface { // Run begins reading from the sensor and blocks until either an error occurs or the context is completed Run(context.Context) error // Concentrations returns a channel of PM concentration readings as they become available from the sensor Concentrations() <-chan *Concentration // ConcentrationSpecs returns a collection of specified measurement ranges supported by the sensor ConcentrationSpecs() []*ConcentrationSpec }
ParticulateMatterSensor defines a sensor for measuring concentrations of particulate matter in air
Click to show internal directories.
Click to hide internal directories.