weathersensor

package
v0.0.0-...-74267fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListDevices

type ListDevices struct {
	ListDevices *bool `kernel:"flag,list-devices,List Devices"`
}

func (*ListDevices) PostInit

func (s *ListDevices) PostInit() error

type Service

type Service struct {
	Daemon         *kernel.Daemon        `kernel:"inject"`
	Cron           *cron.CronService     `kernel:"inject"`
	Config         config.Manager        `kernel:"inject"`
	DatabaseBroker broker.DatabaseBroker `kernel:"inject"`
	Stations       *station.Stations     `kernel:"inject"`
	Rest           *rest.Server          `kernel:"inject"`
	WebPrefix      *string               `kernel:"flag,web-prefix,Prefix for http endpoints,/i"`
	// contains filtered or unexported fields
}

func (*Service) GetHttp

func (s *Service) GetHttp(method, stationId, sensorId string) *station2.Sensor

func (*Service) GetPublisher

func (s *Service) GetPublisher(id string) publisher.Publisher

func (*Service) PollDevice

func (s *Service) PollDevice(dev device.Device, instance device.Instance, publisher publisher.Publisher, cronDef string) error

PollDevice will configure a task that will poll the given instance based on a cron definition. Any errors returned by the device when it's polled will be reported in the log.

func (*Service) PostInit

func (s *Service) PostInit() error

func (*Service) PublishMetric

func (s *Service) PublishMetric(m api.Metric) error

func (*Service) RunDevice

func (s *Service) RunDevice(dev device.Device, instance device.Instance, publisher publisher.Publisher)

RunDevice will call the instance in a separate goroutine. Any error returned by the device will be logged, and it will retry the device after a short delay.

func (*Service) Start

func (s *Service) Start() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL