Documentation ¶
Index ¶
Constants ¶
View Source
const LOG_TAG = "[AntiSpam] "
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AkismetChecker ¶
type AkismetChecker struct {
// contains filtered or unexported fields
}
func (*AkismetChecker) Check ¶
func (c *AkismetChecker) Check(p *CheckerParams) (bool, error)
func (*AkismetChecker) Name ¶
func (*AkismetChecker) Name() string
type AkismetReqParams ¶
type AkismetReqParams struct { Blog string `name:"blog"` // required UserIP string `name:"user_ip"` // required UserAgent string `name:"user_agent"` // required CommentType string `name:"comment_type"` CommentAuthor string `name:"comment_author"` CommentAuthorEmail string `name:"comment_author_email"` CommentAuthorURL string `name:"comment_author_url"` CommentContent string `name:"comment_content"` UserRole string `name:"user_role"` Referrer string `name:"referrer"` Permalink string `name:"permalink"` BlogLang string `name:"blog_lang"` BlogCharset string `name:"blog_charset"` }
type AliyunChecker ¶
func (*AliyunChecker) Check ¶
func (c *AliyunChecker) Check(p *CheckerParams) (bool, error)
阿里云反垃圾 @link https://help.aliyun.com/document_detail/70409.html @link https://help.aliyun.com/document_detail/107743.html 接入地址
func (*AliyunChecker) Name ¶
func (*AliyunChecker) Name() string
type AntiSpam ¶
type AntiSpam struct {
// contains filtered or unexported fields
}
func (AntiSpam) CheckAndBlock ¶
func (as AntiSpam) CheckAndBlock(params *CheckerParams)
Check and block comment if it is spam, the function is exposed and can be called by other modules
type AntiSpamConf ¶
type AntiSpamConf struct { config.ModeratorConf OnBlockComment func(commentID uint) OnUpdateComment func(commentID uint, content string) }
type Checker ¶
type Checker interface { Name() string Check(p *CheckerParams) (bool, error) }
func NewAkismetChecker ¶
func NewAliyunChecker ¶
func NewTencentChecker ¶
type CheckerParams ¶
type KeywordsChecker ¶
type KeywordsChecker struct {
// contains filtered or unexported fields
}
func NewKeywordsChecker ¶
func NewKeywordsChecker(conf *KeywordsCheckerConf) *KeywordsChecker
func (*KeywordsChecker) Check ¶
func (c *KeywordsChecker) Check(p *CheckerParams) (bool, error)
func (*KeywordsChecker) Name ¶
func (*KeywordsChecker) Name() string
type KeywordsCheckerConf ¶
type KwCheckerMode ¶
type KwCheckerMode int
const ( KwCheckerModeBlock KwCheckerMode = iota // 仅拦截 KwCheckerModeReplace // 仅替换关键词 )
type TencentChecker ¶
func (*TencentChecker) Check ¶
func (c *TencentChecker) Check(p *CheckerParams) (bool, error)
腾讯云文本内容安全 TMS @link https://cloud.tencent.com/document/product/1124/51860 @link https://console.cloud.tencent.com/cms/text/overview
func (*TencentChecker) Name ¶
func (*TencentChecker) Name() string
Click to show internal directories.
Click to hide internal directories.