Documentation ¶
Index ¶
Constants ¶
View Source
const (
// DefaultCollection 默认存储敏感词的集合
DefaultCollection = "dirties"
)
View Source
const (
// DefaultDelim 默认读取敏感词的分隔符
DefaultDelim = '\n'
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryConfig ¶
type MemoryConfig struct { // Reader 敏感词数据源 Reader io.Reader // Delim 读取数据的分隔符 Delim byte // DataSource 敏感词数据源 DataSource []string }
MemoryConfig 敏感词内存存储配置
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore 提供内存存储敏感词
func NewMemoryStore ¶
func NewMemoryStore(config MemoryConfig) (*MemoryStore, error)
NewMemoryStore 创建敏感词内存存储
type MongoConfig ¶
type MongoConfig struct { // URL MongoDB连接字符串 URL string // Session 当前会话 Session *mgo.Session // DB 存储敏感词的数据库名称(默认使用会话提供的默认DB) DB string // Collection 存储敏感词的集合名称 Collection string }
MongoConfig 敏感词MongoDB存储配置
type MongoStore ¶
type MongoStore struct {
// contains filtered or unexported fields
}
MongoStore 提供内存存储敏感词
func NewMongoStore ¶
func NewMongoStore(config MongoConfig) (*MongoStore, error)
NewMongoStore 创建敏感词MongoDB存储
Click to show internal directories.
Click to hide internal directories.