Add SPC provider parsing helpers
This commit is contained in:
45
internal/providers/spc/raw.go
Normal file
45
internal/providers/spc/raw.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package spc
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
// RawConvectiveOutlookBundle is the provider payload shape for SPC convective
|
||||
// outlook fetch bundles.
|
||||
type RawConvectiveOutlookBundle struct {
|
||||
LocationID string `json:"locationId,omitempty"`
|
||||
LocationName string `json:"locationName,omitempty"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
FetchedAt time.Time `json:"fetchedAt"`
|
||||
Products []RawOutlookProduct `json:"products"`
|
||||
Discussions []RawDiscussionPage `json:"discussions"`
|
||||
RSS *RawRSSFeed `json:"rss,omitempty"`
|
||||
}
|
||||
|
||||
// RawOutlookProduct contains one fetched SPC GeoJSON product.
|
||||
type RawOutlookProduct struct {
|
||||
Key string `json:"key"`
|
||||
Day int `json:"day"`
|
||||
OutlookType string `json:"outlookType"`
|
||||
URL string `json:"url"`
|
||||
FetchedAt time.Time `json:"fetchedAt"`
|
||||
Body json.RawMessage `json:"body"`
|
||||
}
|
||||
|
||||
// RawDiscussionPage contains one fetched SPC print page.
|
||||
type RawDiscussionPage struct {
|
||||
Key string `json:"key"`
|
||||
Day int `json:"day"`
|
||||
URL string `json:"url"`
|
||||
FetchedAt time.Time `json:"fetchedAt"`
|
||||
Body string `json:"body"`
|
||||
}
|
||||
|
||||
// RawRSSFeed contains optional fetched SPC RSS metadata.
|
||||
type RawRSSFeed struct {
|
||||
URL string `json:"url"`
|
||||
FetchedAt time.Time `json:"fetchedAt"`
|
||||
Body string `json:"body"`
|
||||
}
|
||||
Reference in New Issue
Block a user