Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Location ¶
type Location struct { // Name of the location, optional. Name string `yaml:"name,omitempty"` // Latitude of the Location. // This can be in decimal degrees, or in dd:mm.mm or dd:mm:ss formats. // North is positive. Latitude string `yaml:"latitude"` // Longitude of the Location. // This can be in decimal degrees, or in dd:mm.mm or dd:mm:ss formats. // East is positive, West negative. Longitude string `yaml:"longitude"` // Altitude of the Location in meters. Altitude float64 `yaml:"altitude,omitempty"` // Notes of the location, optional. Notes string `yaml:"notes,omitempty"` }
Location represents a location on the Earth's surface.
type Reading ¶
type Reading struct { ID string `yaml:"-"` // Source the source within the received data for a reading Source string `yaml:"source"` // Type of the reading. This must match the case-insensitive id of a Unit. // If absent or not a valid Unit id, then this is taken as a placeholder and the reading/graphs are ignored. Type string `yaml:"type,omitempty"` // If set, use is the case-insensitive id of the Unit that is required for the Reading. // If not set then Type is the unit used. // // e.g. the device might provide temperature in Fahrenheit, but we want Celsius. // In that instance Type is "Fahrenheit" and Use is "Celsius". Use string `yaml:"use,omitempty"` // contains filtered or unexported fields }
Reading defines a sensor available within a collection
func ReadingFromContext ¶
type Sensors ¶
type Sensors struct { ID string `yaml:"-"` // Name of the Readings collection Name string `yaml:"name"` // Source of data for this collection Source Source `yaml:"source"` // Format of the message, default is json Format string // Timestamp Path to timestamp, "" for none Timestamp string // Reading's provided by this collection Readings map[string]*Reading `yaml:"readings"` // contains filtered or unexported fields }
Sensors define a Reading collection within the Station. A Reading collection is
func SensorsFromContext ¶
func (*Sensors) ReadingsKeys ¶
ReadingsKeys returns a slice containing the keys for each Reading
type Source ¶
type Source struct { WUnderground string `yaml:"wunderground,omitempty"` Http *Http `yaml:"ecowitt,omitempty"` Amqp *amqp.Queue `yaml:"amqp,omitempty"` Mqtt *mqtt.Queue `yaml:"mqtt,omitempty"` }
Source defines the source of data for a Sensors collection. You must define one of these, otherwise no data will be received. You can define multiple entries here
type Station ¶
type Station struct { ID string `yaml:"-"` // Name of the station Name string `yaml:"name"` // Location of the station Location Location `yaml:"location,omitempty"` // One or more Sensors collection Sensors map[string]*Sensors `yaml:"sensors"` // contains filtered or unexported fields }
Station defines a Weather Station at a specific location. It consists of one or more Reading's
func StationFromContext ¶
type Visitor ¶
type Visitor interface { VisitStations(s *Stations) error VisitStation(s *Station) error VisitSensors(s *Sensors) error VisitReading(s *Reading) error }
func FromContext ¶
type VisitorBuilder ¶
type VisitorBuilder interface { Stations(t task.Task) VisitorBuilder Station(t task.Task) VisitorBuilder Sensors(t task.Task) VisitorBuilder Reading(t task.Task) VisitorBuilder WithContext(context.Context) Visitor }
func NewVisitor ¶
func NewVisitor() VisitorBuilder
Click to show internal directories.
Click to hide internal directories.