43 lines
607 B
Go
43 lines
607 B
Go
package config
|
|||
|
|
|
||
|
|
// Config holds all application configuration.
|
||
|
|
type Config struct {
|
||
|
|
Serial SerialConfig
|
||
|
|
Telegram TelegramConfig
|
||
|
|
SQLite SQLiteConfig
|
||
|
|
Socket SocketConfig
|
||
|
|
Pulsar PulsarConfig
|
||
|
|
Log LogConfig
|
||
|
|
}
|
||
|
|
|
||
|
|
type SerialConfig struct {
|
||
|
|
Device string
|
||
|
|
Baudrate int
|
||
|
|
LogRaw bool
|
||
|
|
}
|
||
|
|
|
||
|
|
type TelegramConfig struct {
|
||
|
|
TCP bool
|
||
|
|
Pulsar bool
|
||
|
|
}
|
||
|
|
|
||
|
|
type SQLiteConfig struct {
|
||
|
|
File string
|
||
|
|
Init bool
|
||
|
|
}
|
||
|
|
|
||
|
|
type SocketConfig struct {
|
||
|
|
Address string
|
||
|
|
}
|
||
|
|
|
||
|
|
type PulsarConfig struct {
|
||
|
|
URL string
|
||
|
|
Topic string
|
||
|
|
Name string
|
||
|
|
}
|
||
|
|
|
||
|
|
type LogConfig struct {
|
||
|
|
Dir string
|
||
|
|
MaxAge int // days
|
||
|
|
RotateHour int
|
||
|
|
}
|