Add configuration and CLI foundation
This commit is contained in:
48
internal/config/defaults.go
Normal file
48
internal/config/defaults.go
Normal file
@@ -0,0 +1,48 @@
|
||||
package config
|
||||
|
||||
import "time"
|
||||
|
||||
const DefaultPath = "/usr/local/etc/weatherreporter/config.yml"
|
||||
|
||||
func Defaults() Config {
|
||||
return Config{
|
||||
WeatherAPI: WeatherAPIConfig{
|
||||
Timeout: 10 * time.Second,
|
||||
Precision: 1,
|
||||
Units: "us",
|
||||
Timezone: "Chicago",
|
||||
Format: "json",
|
||||
},
|
||||
MissingSource: MissingSourceConfig{
|
||||
Default: MissingSourceWarn,
|
||||
Sources: map[string]MissingSourcePolicy{},
|
||||
},
|
||||
Scriptorium: ScriptoriumConfig{
|
||||
Binary: "scriptorium",
|
||||
Timeout: 2 * time.Minute,
|
||||
},
|
||||
Workspace: WorkspaceConfig{
|
||||
Root: "workspace",
|
||||
SnapshotsDir: "snapshots",
|
||||
ReportsDir: "reports",
|
||||
DataPackagesDir: "data-packages",
|
||||
PreflightDir: "preflight",
|
||||
},
|
||||
Reports: ReportOutputConfig{
|
||||
OutputDir: "reports",
|
||||
Paths: map[string]string{},
|
||||
},
|
||||
Dayparts: []DaypartConfig{
|
||||
{Name: "overnight", Start: "00:00", End: "06:00"},
|
||||
{Name: "morning", Start: "06:00", End: "12:00"},
|
||||
{Name: "afternoon", Start: "12:00", End: "18:00"},
|
||||
{Name: "evening", Start: "18:00", End: "24:00"},
|
||||
},
|
||||
RecentChange: RecentChangeConfig{
|
||||
TemperatureDegrees: 5,
|
||||
PrecipProbabilityPoints: 20,
|
||||
WindGustMilesPerHour: 10,
|
||||
PrecipTimingShiftMinutes: 120,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user