Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) GitHubReadme(ctx context.Context, owner, repo, ref string) (*GitHubReadme, error)
- func (c *Client) GovernmentPress(ctx context.Context, limit int) ([]PressRelease, error)
- func (c *Client) HackerNewsTopStories(ctx context.Context, limit int) ([]HNStory, error)
- func (c *Client) WeatherAt(ctx context.Context, lat, lon float64, hours int) ([]Weather, error)
- func (c *Client) WhiteHouseRecentPosts(ctx context.Context, limit int) ([]WhiteHousePost, error)
- func (c *Client) WikidataLookup(ctx context.Context, name string) (*WikidataEntity, error)
- func (c *Client) WikipediaSummary(ctx context.Context, title string) (*WikiSummary, error)
- type GitHubReadme
- type HNStory
- type PressRelease
- type Weather
- type WhiteHousePost
- type WikiSummary
- type WikidataEntity
Constants ¶
This section is empty.
Variables ¶
var GovernmentPressFeeds = []string{
"https://www.whitehouse.gov/feed/",
"https://www.gov.uk/government/announcements.atom",
"https://news.gc.ca/web/fd-en.do?format=rss",
"https://ec.europa.eu/commission/presscorner/home/en",
}
GovernmentPressFeeds is a curated set of RSS feeds for legal, public, API-free press releases.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is Aether's internal aggregator for all OpenAPI integrations.
The Client is intentionally simple: it wraps the shared internal HTTP fetcher. Actual service logic (Wikipedia, HN, GitHub, etc.) lives in separate files within this package.
The design allows:
- zero-copy reuse of Aether’s HTTP/cache/robots pipeline
- strong isolation between integrations
- safe concurrent usage across goroutines
OpenAPI Client is safe for concurrent use.
func New ¶
New constructs a new OpenAPI client from the shared internal HTTP client.
This constructor is invoked by aether.NewClient and must receive the same httpclient.Client instance that the rest of Aether uses to ensure consistent caching, User-Agent identity, and robots.txt behavior.
cfg and logger are passed through without modification so that all OpenAPI integrations use the same configuration and logging preferences.
func (*Client) GitHubReadme ¶
GitHubReadme fetches the README.md file for the given repository. ref may be empty, in which case \"main\" is assumed.
func (*Client) GovernmentPress ¶
GovernmentPress retrieves recent press releases from major agencies.
func (*Client) HackerNewsTopStories ¶
HackerNewsTopStories retrieves the top N Hacker News stories. limit is clamped to a sensible maximum to avoid excessive calls.
func (*Client) WhiteHouseRecentPosts ¶
WhiteHouseRecentPosts retrieves the latest N posts from whitehouse.gov using the WP JSON API.
func (*Client) WikidataLookup ¶
WikidataLookup searches Wikidata for the best entity match using SPARQL.
func (*Client) WikipediaSummary ¶
WikipediaSummary fetches a summary for the given title from the English Wikipedia REST API.
Title is automatically URL-escaped and may contain spaces.
type GitHubReadme ¶
GitHubReadme represents a normalized GitHub README document.
type HNStory ¶
type HNStory struct {
ID int64
Title string
URL string
Author string
Score int
Time time.Time
CommentCount int
}
HNStory represents a normalized Hacker News story.
type PressRelease ¶
PressRelease represents a normalized government press item.
type Weather ¶
type Weather struct {
Time time.Time
Temperature float64
Humidity float64
WindSpeed float64
Summary string
}
Weather represents a normalized hourly weather entry.
type WhiteHousePost ¶
WhiteHousePost represents a normalized White House post.