feedkit now contains a reusable core, while weatherfeeder is a concrete implementation that includes weather-specific functions.
24 lines
567 B
Go
24 lines
567 B
Go
package model
|
|
|
|
// Kind identifies which payload an Event carries.
|
|
type Kind string
|
|
|
|
const (
|
|
KindObservation Kind = "observation"
|
|
KindForecast Kind = "forecast"
|
|
KindAlert Kind = "alert"
|
|
)
|
|
|
|
// IsKnown returns true if k is one of the kinds supported by this binary.
|
|
//
|
|
// This is intentionally strict: if you add new kinds later, update this list.
|
|
// That keeps validation useful (it catches partially-constructed events).
|
|
func (k Kind) IsKnown() bool {
|
|
switch k {
|
|
case KindObservation, KindForecast, KindAlert:
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|