Files

65 lines
1.8 KiB
Go
Raw Permalink Normal View History

2026-05-29 16:58:18 +00:00
package config
import "time"
const DefaultPath = "/usr/local/etc/weatherreporter/config.yml"
func Defaults() Config {
return Config{
WeatherAPI: WeatherAPIConfig{
Timeout: 10 * time.Second,
Precision: 0,
2026-05-29 16:58:18 +00:00
Units: "us",
Timezone: "America/Chicago",
2026-05-29 16:58:18 +00:00
Format: "json",
},
Location: LocationConfig{
ID: "home",
Name: "Brentwood",
Region: "St. Louis Metro",
},
2026-06-07 23:13:54 +00:00
Secrets: SecretsConfig{
Directory: "",
},
Output: OutputConfig{
Directory: "",
},
Notify: NotifyConfig{
Distributor: DistributorNotifyConfig{
Enabled: false,
Endpoint: "https://distributor.example.com",
TokenEnv: "DISTRIBUTOR_UPLOAD_TOKEN",
Timeout: 30 * time.Second,
FailurePolicy: NotifyFailureError,
PipelineIDTemplate: "",
BundleIDTemplate: "weatherreporter.{location_id}.{report_id}",
IdempotencyKeyTemplate: "{bundle_id}.{run_id}",
Batch: DistributorBatchNotifyConfig{
Enabled: true,
PipelineIDTemplate: "weatherreporter",
BundleIDTemplate: "weatherreporter.{location_id}.{batch}",
IdempotencyKeyTemplate: "{bundle_id}.{batch_run_id}",
},
},
},
2026-05-29 16:58:18 +00:00
MissingSource: MissingSourceConfig{
Default: MissingSourceWarn,
Sources: map[string]MissingSourcePolicy{},
},
Promptkit: PromptkitConfig{
Timeout: 2 * time.Minute,
Local: PromptkitLocalConfig{
ConcurrencyLimit: 1,
},
},
2026-05-29 16:58:18 +00:00
Dayparts: []DaypartConfig{
{Name: "overnight", Start: "00:00", End: "06:00"},
{Name: "morning", Start: "06:00", End: "10:00"},
{Name: "midday", Start: "10:00", End: "15:00"},
{Name: "afternoon", Start: "15:00", End: "17:00"},
{Name: "evening", Start: "17:00", End: "24:00"},
2026-05-29 16:58:18 +00:00
},
Reports: map[string]ReportConfig{},
2026-05-29 16:58:18 +00:00
}
}