config

package
v0.0.0-...-0c309f4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Battery

type Battery struct {
	Address string `yaml:"address"`

	PollInterval time.Duration `yaml:"poll_interval"`
}

type Bridge

type Bridge struct {
	Flatten bool `yaml:"flatten"`
	Encrypt bool `yaml:"encrypt"`
}

type Car

type Car struct {
	Address string `yaml:"address"`

	TankVolume float32 `yaml:"tank_volume"`

	PollInterval time.Duration `yaml:"poll_interval"`
}

type Config

type Config struct {
	*viper.Viper `yaml:"-"`

	Debug bool `yaml:"debug"`

	DataDir string `yaml:"data_dir"`

	Broker      mqtt.BrokerConfig `yaml:"broker"`
	BrokerCloud mqtt.BrokerConfig `yaml:"broker_cloud"`

	Display     Display     `yaml:"display"`
	Web         Web         `yaml:"web"`
	GPS         GPS         `yaml:"gps"`
	Car         Car         `yaml:"car"`
	Solar       Solar       `yaml:"solar"`
	Battery     Battery     `yaml:"battery"`
	Environment Environment `yaml:"env"`
	Modem       Modem       `yaml:"modem"`
}

Config contains the main configuration

func NewConfig

func NewConfig(configFile string) (*Config, error)

NewConfig returns a new decoded Config struct

type Display

type Display struct {
	Port string `yaml:"port"`

	Pins struct {
		DC    string `yaml:"dc"`
		Reset string `yaml:"reset"`
		Next  string `yaml:"next"`
	}

	Pages []DisplayPage `yaml:"pages"`
}

type DisplayPage

type DisplayPage struct {
	ID     string `yaml:"id"`
	NextID string `yaml:"next"`
	OverID string `yaml:"over"`

	Time            time.Duration   `yaml:"time"`
	BackgroundColor color.Color     `yaml:"background-color"`
	Widgets         []widget.Widget `yaml:"widgets"`
}

type Environment

type Environment struct{}

type GPS

type GPS struct {
	Port     string `yaml:"port"`
	Baudrate int    `yaml:"baudrate"`

	MinInterval time.Duration `yaml:"min_interval"`
	MinDistance float64       `yaml:"min_distance"`

	OwnTracks OwnTracks `yaml:"owntracks"`
}

type Modem

type Modem struct {
	Address  string `yaml:"address"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`

	PollInterval time.Duration `yaml:"poll_interval"`
}

type OwnTracks

type OwnTracks struct {
	Topic string `yaml:"topic"`
}

type Solar

type Solar struct {
	Address string `yaml:"address"`

	PollInterval time.Duration `yaml:"poll_interval"`
}

type Web

type Web struct {
	// Host is the local machine IP Address to bind the HTTP Server to
	Listen string `yaml:"listen"`

	// Directory of frontend assets if not bundled
	Static string `yaml:"static"`

	// BaseURL at which the VANd web server is accessible
	BaseURL string `yaml:"base_url"`
}

Jump to

Keyboard shortcuts

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