-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurator.go
39 lines (30 loc) · 1.24 KB
/
curator.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
var MyCurator Curator
type Curator interface {
// Init will be called on initialization, use this function to
// initialize your curation module
Init() error
// OnPostAdded will be called when new posts are retrieved
// from other peers, if this functions returns false, the
// content will be rejected (e.g. in the case of spam) and not
// stored by our node
OnPostAdded(obj *Post, isWhitelabeled bool) bool
// OnCommentAdded will be called when new comments are
// retrieved from other peers, if this functions returns
// false, the content will be rejected (e.g. in the case of
// spam) and not stored by our node
OnCommentAdded(obj *Comment, isWhitelabeled bool) bool
// GetContent gives back an ordered array of post hashes of
// suggested content by the curation module
GetContent(params map[string]interface{}) []string
// FlagContent marks or unmarks hashes as spam. True means
// content is flagged as spam, false means content is not
// flagged as spam
FlagContent(hash string, isFlagged bool)
// UpvoteContent is called when user upvotes a content
UpvoteContent(hash string)
// DownvoteContent is called when user downvotes a content
DownvoteContent(hash string)
// Close destruct curator module
Close() error
}