rss and rss item and encode

Former-commit-id: 333b5635cc0eb22964403cc78f660e02a830f077
This commit is contained in:
bel
2019-06-22 10:07:52 -06:00
parent be065c5dcb
commit fc94f94bd2
10 changed files with 353 additions and 52 deletions

View File

@@ -12,7 +12,6 @@ import (
type Item struct {
Key string
*config.Encodable
}
const nsLast = "nsLast"
@@ -23,8 +22,7 @@ var forever = time.Duration(time.Hour * 99999)
func NewItem(key string, interval time.Duration) (*Item, error) {
i := &Item{
Key: key,
Encodable: &config.Encodable{},
Key: key,
}
if err := i.setInterval(interval); err != nil {
@@ -124,3 +122,11 @@ func (i *Item) getLast() (time.Time, error) {
}
return t, nil
}
func (i *Item) Encode() ([]byte, error) {
return config.Encode(i)
}
func (i *Item) Decode(b []byte) error {
return config.Decode(b, i)
}