weatherfeeder: split the former maximumdirect.net/weatherd project in two.
feedkit now contains a reusable core, while weatherfeeder is a concrete implementation that includes weather-specific functions.
This commit is contained in:
23
internal/model/kind.go
Normal file
23
internal/model/kind.go
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user