config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAddress  = ":8000"
	DefaultBaudRate = 19200
	DefaultDataBits = 8
	DefaultStopBits = 1
	DefaultParity   = "N"
	DefaultTimeout  = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address   string  `json:"address,omitempty" yaml:"address,omitempty"`
	Subsystem string  `json:"subsystem,omitempty" yaml:"subsystem,omitempty"`
	Serial    Serial  `json:"serial,omitempty" yaml:"serial,omitempty"`
	Gauges    []Gauge `json:"gauges,omitempty" yaml:"gauges,omitempty"`
}

func ParseYaml

func ParseYaml(r io.Reader) (*Config, error)

func ReadYaml

func ReadYaml(path string) (*Config, error)

type Gauge

type Gauge struct {
	Name       string  `json:"name,omitempty" yaml:"name,omitempty"`
	Label      string  `json:"label,omitempty" yaml:"label,omitempty"`
	Help       string  `json:"help,omitempty" yaml:"help,omitempty"`
	Multiplier float64 `json:"multiplier,omitempty" yaml:"multiplier,omitempty"`
}

type Serial

type Serial struct {
	Path     string        `json:"path,omitempty" yaml:"path,omitempty"`
	BaudRate int           `json:"baudRate,omitempty" yaml:"baudRate,omitempty"`
	DataBits int           `json:"dataBits,omitempty" yaml:"dataBits,omitempty"`
	StopBits int           `json:"stopBits,omitempty" yaml:"stopBits,omitempty"`
	Parity   string        `json:"parity,omitempty" yaml:"parity,omitempty"`
	Timeout  time.Duration `json:"timeout,omitempty" yaml:"timeout,omitempty"`
}

Jump to

Keyboard shortcuts

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