config

package
v0.0.0-...-dbebf35 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerConf

type ControllerConf struct{ model.System }

ControllerConf controller config

func (*ControllerConf) CheckValid

func (conf *ControllerConf) CheckValid(hwConf *HardwareConf) error

func (*ControllerConf) Init

func (conf *ControllerConf) Init(hwConf *HardwareConf)

func (*ControllerConf) Read

func (conf *ControllerConf) Read(dir string) error

func (*ControllerConf) Write

func (conf *ControllerConf) Write(dir string) error

type HardwareConf

type HardwareConf struct {
	Sensors []string
	Buttons []uint8
	Relays  []uint8
}

HardwareConf hardware config

func (*HardwareConf) Read

func (conf *HardwareConf) Read(dir string) error
Example
conf := HardwareConf{}
err := conf.Read("../../configs")
if err != nil {
	panic(err)
}
fmt.Println(len(conf.Sensors))
fmt.Println(len(conf.Buttons))
fmt.Println(len(conf.Relays))
Output:

2
3
6

type ServerConf

type ServerConf struct {
	Address     string
	Path        string
	Credentials map[string]string
}

ServerConf HTTP server config

func (*ServerConf) Read

func (conf *ServerConf) Read(dir string) error

Jump to

Keyboard shortcuts

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