Documentation
¶
Index ¶
- func ACLEDEventCategory(eventType string) string
- func ACLEDEventSeverity(eventType string, fatalities int) string
- func ACLEDISO2(iso3 string) string
- func EONETSeverity(categoryID string) string
- func GDELTCountryISO2(country string) string
- func NormalizeConflictType(typeCode string) string
- func StripHTML(value string) string
- func USGSSeverity(mag float64, alertLevel string) string
- type ACLEDEvent
- type ACLEDItem
- type ACLEDResponse
- type EONETCategory
- type EONETEvent
- type EONETGeometry
- type EONETItem
- type EONETResponse
- type EONETSource
- type FBIWantedEntry
- type FBIWantedResponse
- type FeedItem
- func ParseFBIWanted(body []byte) ([]FeedItem, int, error)
- func ParseFCDOAtom(body []byte) ([]FeedItem, error)
- func ParseFeed(xml string) []FeedItem
- func ParseGDELT(body []byte) ([]FeedItem, error)
- func ParseGermanAATravelWarnings(body []byte) ([]FeedItem, error)
- func ParseHTMLAnchors(body string, baseURL string) []FeedItem
- func ParseTelegram(body string, channel string) []FeedItem
- type FeodoEntry
- type FeodoItem
- type GDELTArticle
- type GDELTResponse
- type UCDPConflict
- type UCDPItem
- type USGSFeature
- type USGSGeoJSON
- type USGSGeometry
- type USGSItem
- type USGSProperties
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ACLEDEventCategory ¶ added in v1.1.0
ACLEDEventCategory maps ACLED event types to EUOSINT categories.
func ACLEDEventSeverity ¶ added in v1.1.0
ACLEDEventSeverity infers severity from ACLED event characteristics.
func ACLEDISO2 ¶ added in v1.1.0
ACLEDISO2 converts an ACLED ISO3 code to ISO2. Returns "" if unknown.
func EONETSeverity ¶ added in v1.3.0
EONETSeverity returns severity based on EONET category.
func GDELTCountryISO2 ¶ added in v1.3.0
GDELTCountryISO2 converts a GDELT sourcecountry string to ISO2.
func NormalizeConflictType ¶ added in v1.4.0
func StripHTML ¶
StripHTML removes script/style tags, strips remaining HTML tags, unescapes entities, and normalizes whitespace.
func USGSSeverity ¶ added in v1.3.0
USGSSeverity returns severity based on magnitude.
Types ¶
type ACLEDEvent ¶ added in v1.1.0
type ACLEDEvent struct {
DataID json.Number `json:"data_id"`
EventDate string `json:"event_date"`
Year json.Number `json:"year"`
EventType string `json:"event_type"`
SubEventType string `json:"sub_event_type"`
Actor1 string `json:"actor1"`
Actor2 string `json:"actor2"`
Country string `json:"country"`
ISO3 string `json:"iso3"`
Region string `json:"region"`
Admin1 string `json:"admin1"`
Admin2 string `json:"admin2"`
Admin3 string `json:"admin3"`
Location string `json:"location"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
Source string `json:"source"`
SourceScale string `json:"source_scale"`
Notes string `json:"notes"`
Fatalities json.Number `json:"fatalities"`
Tags string `json:"tags"`
Timestamp json.Number `json:"timestamp"`
}
ACLEDEvent is a single conflict event from the ACLED API.
type ACLEDItem ¶ added in v1.1.0
type ACLEDItem struct {
FeedItem
EventType string
Fatalities int
Country string // Full country name from ACLED
ISO3 string // 3-letter ISO code
Region string // ACLED region (e.g. "Europe", "Middle East")
}
ACLEDItem extends FeedItem with ACLED-specific metadata needed for category/severity mapping in the normalizer.
type ACLEDResponse ¶ added in v1.1.0
type ACLEDResponse struct {
Status int `json:"status"`
Count int `json:"count"`
Data []ACLEDEvent `json:"data"`
}
ACLEDResponse is the top-level response from the ACLED API.
type EONETCategory ¶ added in v1.3.0
type EONETEvent ¶ added in v1.3.0
type EONETEvent struct {
ID string `json:"id"`
Title string `json:"title"`
Link string `json:"link"`
Categories []EONETCategory `json:"categories"`
Sources []EONETSource `json:"sources"`
Geometry []EONETGeometry `json:"geometry"`
}
type EONETGeometry ¶ added in v1.3.0
type EONETItem ¶ added in v1.3.0
EONETItem extends FeedItem with EONET-specific metadata.
func ParseEONET ¶ added in v1.3.0
ParseEONET parses a NASA EONET v3 JSON response.
type EONETResponse ¶ added in v1.3.0
type EONETResponse struct {
Events []EONETEvent `json:"events"`
}
EONETResponse is the top-level response from NASA EONET v3.
type EONETSource ¶ added in v1.3.0
type FBIWantedEntry ¶
type FBIWantedEntry struct {
UID string `json:"uid"`
Title string `json:"title"`
Description string `json:"description"`
Details string `json:"details"`
Caution string `json:"caution"`
WarningMessage string `json:"warning_message"`
Remarks string `json:"remarks"`
Sex string `json:"sex"`
Nationality string `json:"nationality"`
PlaceOfBirth string `json:"place_of_birth"`
DatesOfBirthUsed []string `json:"dates_of_birth_used"`
Aliases []string `json:"aliases"`
Subjects []string `json:"subjects"`
Status string `json:"status"`
PersonClassification string `json:"person_classification"`
PosterClassification string `json:"poster_classification"`
RewardText string `json:"reward_text"`
RewardMin int `json:"reward_min"`
RewardMax int `json:"reward_max"`
URL string `json:"url"`
Path string `json:"path"`
Publication string `json:"publication"`
Modified string `json:"modified"`
FieldOffices []string `json:"field_offices"`
PossibleCountries []string `json:"possible_countries"`
PossibleStates []string `json:"possible_states"`
Images []struct {
Thumb string `json:"thumb"`
Original string `json:"original"`
Large string `json:"large"`
Caption string `json:"caption"`
} `json:"images"`
}
FBIWantedEntry is a single person/case from the FBI Wanted API.
type FBIWantedResponse ¶
type FBIWantedResponse struct {
Total int `json:"total"`
Page int `json:"page"`
Items []FBIWantedEntry `json:"items"`
}
FBIWantedResponse is the top-level response from the FBI Wanted API.
type FeedItem ¶
type FeedItem struct {
Title string
Link string
Published string
Author string
Summary string
Tags []string
Lat float64 // from <georss:point> if present
Lng float64 // from <georss:point> if present
}
func ParseFBIWanted ¶
ParseFBIWanted parses the FBI Wanted API JSON response into FeedItems.
func ParseFCDOAtom ¶
ParseFCDOAtom parses a UK FCDO (Foreign, Commonwealth & Development Office) Atom feed containing travel advice entries. This delegates to the generic Atom parser in ParseFeed and returns the results.
func ParseGDELT ¶ added in v1.3.0
ParseGDELT parses a GDELT v2 ArtList JSON response.
func ParseGermanAATravelWarnings ¶
ParseGermanAATravelWarnings parses the JSON response from the German Auswärtiges Amt (Federal Foreign Office) travel warning open-data API. The API returns an object whose keys are numeric country IDs and values contain the warning metadata.
func ParseHTMLAnchors ¶
func ParseTelegram ¶ added in v1.0.4
ParseTelegram extracts messages from a Telegram t.me/s/<channel> HTML page. Each message becomes a FeedItem with:
- Title: first ~200 chars of the text content
- Link: https://t.me/<channel>/<msgid>
- Published: datetime from <time> tag
type FeodoEntry ¶ added in v1.3.0
type FeodoEntry struct {
IPAddress string `json:"ip_address"`
Port int `json:"port"`
Status string `json:"status"` // "online" or "offline"
Hostname string `json:"hostname"`
ASNumber int `json:"as_number"`
ASName string `json:"as_name"`
Country string `json:"country"` // 2-letter country code
FirstSeen string `json:"first_seen"`
LastOnline string `json:"last_online"`
Malware string `json:"malware"` // e.g. "Dridex", "TrickBot"
}
FeodoEntry is a single entry from the Feodo Tracker IP blocklist.
type FeodoItem ¶ added in v1.3.0
type FeodoItem struct {
FeedItem
IPAddress string
Port int
Status string
Malware string
Country string // 2-letter code
ASName string
}
FeodoItem extends FeedItem with Feodo-specific metadata.
func ParseFeodo ¶ added in v1.3.0
ParseFeodo parses the Feodo Tracker JSON blocklist, returning only online entries (active C2 servers).
type GDELTArticle ¶ added in v1.3.0
type GDELTResponse ¶ added in v1.3.0
type GDELTResponse struct {
Articles []GDELTArticle `json:"articles"`
}
GDELTResponse is the top-level response from GDELT v2 ArtList mode.
type UCDPConflict ¶ added in v1.4.0
type UCDPConflict struct {
ConflictID string
ConflictName string
TypeOfConflict string // "3" = intrastate, "4" = internationalized intrastate, etc.
IntensityLevel int // 1 = minor, 2 = war
GWNoLoc string // country gwno
Year int
EPEnd int
StartDate string
Region string
SideA string
SideB string
}
func ParseUCDPConflicts ¶ added in v1.4.0
func ParseUCDPConflicts(body []byte) ([]UCDPConflict, error)
type UCDPItem ¶ added in v1.3.0
type UCDPItem struct {
FeedItem
ViolenceType string
Fatalities int
CivilianDeaths int
Country string
CountryCode string
Region string
SideA string
SideB string
DyadName string
Admin1 string
Admin2 string
WhereDescription string
SourceHeadline string
SourceArticle string
SourceOriginal string
WherePrecision int
DatePrecision int
EventClarity int
}
UCDPItem extends FeedItem with UCDP conflict metadata.
type USGSFeature ¶ added in v1.3.0
type USGSFeature struct {
Properties USGSProperties `json:"properties"`
Geometry USGSGeometry `json:"geometry"`
ID string `json:"id"`
}
type USGSGeoJSON ¶ added in v1.3.0
type USGSGeoJSON struct {
Features []USGSFeature `json:"features"`
}
USGSGeoJSON is the top-level GeoJSON FeatureCollection from the USGS earthquake feed.
type USGSGeometry ¶ added in v1.3.0
type USGSGeometry struct {
Coordinates []float64 `json:"coordinates"` // [lng, lat, depth]
}
type USGSItem ¶ added in v1.3.0
type USGSItem struct {
FeedItem
Magnitude float64
Tsunami bool
AlertLevel string // green/yellow/orange/red
}
USGSItem extends FeedItem with earthquake-specific metadata.
func ParseUSGSGeoJSON ¶ added in v1.3.0
ParseUSGSGeoJSON parses a USGS GeoJSON earthquake feed.
type USGSProperties ¶ added in v1.3.0
type USGSProperties struct {
Mag float64 `json:"mag"`
Place string `json:"place"`
Time int64 `json:"time"` // unix ms
URL string `json:"url"`
Title string `json:"title"`
Alert string `json:"alert"` // green/yellow/orange/red
Tsunami int `json:"tsunami"` // 0 or 1
Type string `json:"type"` // "earthquake"
}