store

package
v0.0.0-...-cbc8ce9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

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 创建敏感词内存存储

func (*MemoryStore) Read

func (ms *MemoryStore) Read() <-chan string

Read Read

func (*MemoryStore) ReadAll

func (ms *MemoryStore) ReadAll() ([]string, error)

ReadAll ReadAll

func (*MemoryStore) Remove

func (ms *MemoryStore) Remove(words ...string) error

Remove Remove

func (*MemoryStore) Version

func (ms *MemoryStore) Version() uint64

Version Version

func (*MemoryStore) Write

func (ms *MemoryStore) Write(words ...string) error

Write Write

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL