An adapter presents an existing component through an interface the surrounding application expects. In a Go service, it forms the boundary between stable domain ports and volatile infrastructure libraries. section 11.1.2
The RSS reader adapter implements domain.Fetcher while keeping gofeed types inside the worker. It parses external feeds, converts Feed and Item values into domain.Feed and domain.Article values, and returns only domain objects to the application. section 11.3.3
A practical adapter design provides:
- A compile-time assertion that catches interface mismatches before runtime. section 11.3.3
- A replaceable implementation: tests can use a mock, while production can use RSSReader without changing consuming code. section 11.1.2
RSSReader at the worker boundary
Create RSSReader with gofeed.NewParser, call ParseURLWithContext, map feed metadata and items into domain types, then inject it into fetchAndStore as a domain.Fetcher. The worker can therefore fetch and store articles without depending directly on gofeed models.








