rss and rss item and encode
Former-commit-id: 333b5635cc0eb22964403cc78f660e02a830f077
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user