wioctl

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Schedule int `mapstructure:"schedule,omitempty"`
	Wio      struct {
		BasePath string `mapstructure:"base_path"`
		BasePort string `mapstructure:"base_port"`
	} `mapstructure:"wio"`
	Sensors []Sensor `mapstructure:"sensors"`
}

func LoadConfig

func LoadConfig() (*Config, chan *Config)

LoadConfig returns a config from viper and updates channel

type Sensor

type Sensor struct {
	Name            string `mapstructure:"name"`
	SensorTarget    string `mapstructure:"sensor_target"`
	SensorPath      string `mapstructure:"sensor_path"`
	SensorKey       string `mapstructure:"sensor_key"`
	SensorTokenKey  string `mapstructure:"sensor_token_key"`
	SensorTokenPath string `mapstructure:"sensor_token_path"`
}

type Wioctl

type Wioctl struct {
	// contains filtered or unexported fields
}

Wioctl is the definition for a wioctler

func NewWioctl

func NewWioctl(cfg *Config, influxAddr string, influxToken string) (*Wioctl, error)

NewWioctl generates a populated wioctler

func (*Wioctl) Config

func (w *Wioctl) Config() *Config

Config returns a safe copy of CivoCtl cfg

func (*Wioctl) Run

func (w *Wioctl) Run()

func (*Wioctl) SetConfig

func (w *Wioctl) SetConfig(cfg *Config)

SetConfig sets a safe copy of CivoCtl cfg

type Wioctler

type Wioctler interface {
	Run()
}

Wioctler is the interface for wioctl

Jump to

Keyboard shortcuts

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