40 lines
911 B
Go
40 lines
911 B
Go
package config
|
|
|
|
import (
|
|
"th7/data/thermocouple"
|
|
)
|
|
|
|
type API struct {
|
|
Port int `json:"port"`
|
|
Enabled bool `json:"enabled"`
|
|
Restricted bool `json:"restricted"` // can read/modify DB settings?
|
|
}
|
|
|
|
type Filter struct {
|
|
SampleSize int `json:"sample_size"`
|
|
Type int `json:"type"`
|
|
}
|
|
|
|
type Channel struct {
|
|
Id int `json:"id"`
|
|
Thermo thermocouple.Type `json:"thermocouple"`
|
|
Gain float64 `json:"gain"`
|
|
Offset float64 `json:"offset"`
|
|
Log bool `json:"log"`
|
|
Filter Filter `json:"filter"`
|
|
}
|
|
|
|
type TH7 struct {
|
|
Led bool `json:"LED"`
|
|
Debug bool `json:"debug"`
|
|
NoLog bool `json:"nolog"`
|
|
NoWeb bool `json:"noweb"`
|
|
}
|
|
|
|
type Config struct {
|
|
Board TH7 `json:"TH7"`
|
|
Channels []Channel `json:"channels"`
|
|
DB map[string]interface{} `json:"db"`
|
|
API API `json:"API"`
|
|
}
|