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

20
config/encode.go Normal file
View File

@@ -0,0 +1,20 @@
package config
import (
"bytes"
"encoding/gob"
)
func Encode(v interface{}) ([]byte, error) {
buff := bytes.NewBuffer(nil)
enc := gob.NewEncoder(buff)
err := enc.Encode(v)
return buff.Bytes(), err
}
func Decode(b []byte, v interface{}) error {
buff := bytes.NewBuffer(b)
enc := gob.NewDecoder(buff)
err := enc.Decode(v)
return err
}