Archived
1
0
This repository has been archived on 2023-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
nntpchan/contrib/backends/srndv2/src/srnd/frontend.go
2017-10-10 12:17:38 -04:00

45 lines
779 B
Go

//
// frontend.go
// srnd frontend interfaces
//
//
package srnd
const BumpLimit = 300
// ( message-id, references, newsgroup )
type frontendPost [3]string
func (p frontendPost) MessageID() string {
return p[0]
}
func (p frontendPost) Reference() string {
return p[1]
}
func (p frontendPost) Newsgroup() string {
return p[2]
}
// frontend interface for any type of frontend
type Frontend interface {
// handle new post from nntpd
HandleNewPost(p frontendPost)
// run mainloop
Mainloop()
// do we want posts from a newsgroup?
AllowNewsgroup(group string) bool
// trigger a manual regen of indexes for a root post
Regen(msg ArticleEntry)
// regenerate on mod event
RegenOnModEvent(newsgroup, msgid, root string, page int)
GetCacheHandler() CacheHandler
}