Missing handlers but there we goddamn GO

Former-commit-id: 2505146a54acaf18eadfdebf1dd2720889aef795
This commit is contained in:
bel
2019-06-22 16:23:27 -06:00
parent 093d468f87
commit 35b3ff2c2d
24 changed files with 216 additions and 37 deletions

View File

@@ -22,6 +22,8 @@ type Item struct {
TS time.Time
}
type Items []*Item
func newItem(i *gofeed.Item, contentFilter string) (*Item, error) {
item := &Item{
Title: i.Title,
@@ -88,3 +90,17 @@ func (i *Item) Load(key, ns1 string, ns ...string) error {
}
return config.Decode(b, i)
}
func (is Items) Len() int {
return len(is)
}
func (is Items) Less(i, j int) bool {
return is[j].TS.Before(is[i].TS)
}
func (is Items) Swap(i, j int) {
k := is[i]
is[i] = is[j]
is[j] = k
}