Documentation
¶
Overview ¶
Package feed implements streaming interface to access RSS, Atom, etc. feeds.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EqualSizeBlocks ¶
EqualSizeBlocks generates a sequence of blocks of a given size out of n items.
Example ¶
package main
import (
"fmt"
"slices"
"github.com/skhal/lab/x/feed/internal/feed"
)
func main() {
chunks := slices.Collect(feed.EqualSizeBlocks(3, 7))
fmt.Println(chunks)
}
Output: [{0 3} {3 6} {6 7}]
Types ¶
type Item ¶
type Item struct {
Title string // Title of the item.
Updated *time.Time // When the item was updated.
Published *time.Time // When the item was published.
}
Item is a feed item, be it RSS, Atom, etc.
type Subscription ¶
type Subscription interface {
// Feed generates a stream of feed items. It returns an error if it fails to
// create a stream.
Feed() (Feed, error)
// Close stops the subscription and closes the feed.
Close() error
}
Subscription is a client API to access streamed feed.
func Merge ¶
func Merge(subs []Subscription) Subscription
Merge multiplexes subscriptions into a single subscription.
Click to show internal directories.
Click to hide internal directories.