65 lines
1.8 KiB
Go
65 lines
1.8 KiB
Go
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,
|
|
Units: "us",
|
|
Timezone: "America/Chicago",
|
|
Format: "json",
|
|
},
|
|
Location: LocationConfig{
|
|
ID: "home",
|
|
Name: "Brentwood",
|
|
Region: "St. Louis Metro",
|
|
},
|
|
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}",
|
|
},
|
|
},
|
|
},
|
|
MissingSource: MissingSourceConfig{
|
|
Default: MissingSourceWarn,
|
|
Sources: map[string]MissingSourcePolicy{},
|
|
},
|
|
Promptkit: PromptkitConfig{
|
|
Timeout: 2 * time.Minute,
|
|
Local: PromptkitLocalConfig{
|
|
ConcurrencyLimit: 1,
|
|
},
|
|
},
|
|
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"},
|
|
},
|
|
Reports: map[string]ReportConfig{},
|
|
}
|
|
}
|