feedkit: 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:
2026-01-13 10:40:01 -06:00
parent 977b81e647
commit 0cc2862170
26 changed files with 1553 additions and 0 deletions

30
event/kind.go Normal file
View File

@@ -0,0 +1,30 @@
package event
import (
"fmt"
"strings"
)
// Kind identifies the "type/category" of an event for routing and policy decisions.
//
// Kind is intentionally open-ended (stringly-typed), because different daemons will
// have different kinds:
//
// weatherfeeder: "observation", "forecast", "alert"
// newsfeeder: "article", "breaking", ...
// stockfeeder: "quote", "bar", "news", ...
//
// Conventions (recommended, not required):
// - lowercase
// - words separated by underscores if needed
type Kind string
// ParseKind normalizes and validates a kind string.
// It lowercases and trims whitespace, and rejects empty values.
func ParseKind(s string) (Kind, error) {
k := strings.ToLower(strings.TrimSpace(s))
if k == "" {
return "", fmt.Errorf("kind cannot be empty")
}
return Kind(k), nil
}