forked from jason/cpolis
Added Tags to RSS feed as categories
This commit is contained in:
@ -21,15 +21,17 @@ type Article struct {
|
||||
AuthorID int64
|
||||
}
|
||||
|
||||
// TODO: setCh
|
||||
type ArticleList struct {
|
||||
addCh chan *Article
|
||||
delCh chan uuid.UUID
|
||||
retCh chan *Article
|
||||
getCh chan []Article
|
||||
retCh chan *Article
|
||||
articles []*Article
|
||||
wg sync.WaitGroup
|
||||
}
|
||||
|
||||
// TODO: setCh
|
||||
type TagList struct {
|
||||
addCh chan string
|
||||
getCh chan []string
|
||||
@ -41,8 +43,8 @@ func initArticleList() *ArticleList {
|
||||
return &ArticleList{
|
||||
addCh: make(chan *Article),
|
||||
delCh: make(chan uuid.UUID),
|
||||
retCh: make(chan *Article),
|
||||
getCh: make(chan []Article),
|
||||
retCh: make(chan *Article),
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,7 +92,7 @@ func (tl *TagList) start() {
|
||||
|
||||
func NewArticleList() *ArticleList {
|
||||
list := initArticleList()
|
||||
list.articles = []*Article{}
|
||||
list.articles = make([]*Article, 0)
|
||||
|
||||
list.wg.Add(1)
|
||||
go list.start()
|
||||
@ -148,7 +150,7 @@ func LoadArticleList(filename string) (*ArticleList, error) {
|
||||
|
||||
func NewTagList() *TagList {
|
||||
list := initTagList()
|
||||
list.tags = []string{}
|
||||
list.tags = make([]string, 0)
|
||||
|
||||
list.wg.Add(1)
|
||||
go list.start()
|
||||
|
@ -22,6 +22,9 @@ func initChannel() *Channel {
|
||||
addCh: make(chan *rss.Item),
|
||||
setCh: make(chan rss.Channel),
|
||||
getCh: make(chan rss.Channel),
|
||||
channel: rss.Channel{
|
||||
Items: make([]*rss.Item, 0),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user