-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.go
34 lines (27 loc) · 928 Bytes
/
options.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package river
import (
"time"
"hawx.me/code/riviera/river/mapping"
)
// Options change the behaviour of River.
type Options struct {
// Mapping is the function used to convert a feed item to an item in the
// river.
Mapping mapping.Mapping
// CutOff is the duration after which items are not shown in the river. This
// is given as a negative time and is calculated from the time the feed was
// fetched not the time the item was published.
CutOff time.Duration
// Refresh is the minimum refresh period. If an rss feed does not specify
// when to be fetched this duration will be used.
Refresh time.Duration
// LogLength defines the number of events to keep in the crawl log, per feed.
LogLength int
}
// DefaultOptions are some sensible options to start out with.
var DefaultOptions = Options{
Mapping: mapping.DefaultMapping,
CutOff: -24 * time.Hour,
Refresh: 15 * time.Minute,
LogLength: 0,
}