Documentation
¶
Index ¶
- Variables
- func InitMemFileContent(fileName string) *fileContent
- func IoFileRead(fileName string) chan *string
- func MemScan(mf *MemFiles, searchStr *string) string
- func MemScanFile(fc *fileContent, searchStr *string, counter *Counter, out chan *FileRes)
- func PathFiles(path string) []string
- func Scan(files []string, searchStr *string) string
- func ScanFile(fileName string, searchStr *string, counter *Counter, out chan *FileRes)
- type Counter
- type FileRes
- type MemFiles
- type ScanResult
- type StringArray
Constants ¶
This section is empty.
Variables ¶
View Source
var BufSize = 1024 * 1024 // buf大小
View Source
var LineFeed = byte('\n') //文本换行符标识
View Source
var MaxResult = 10
Functions ¶
func InitMemFileContent ¶
func InitMemFileContent(fileName string) *fileContent
func MemScanFile ¶
扫描文件
Types ¶
type Counter ¶
type Counter struct {
Num int
// contains filtered or unexported fields
}
func InitCounter ¶
type FileRes ¶
type FileRes struct {
File string
Strings StringArray
Num int
}
单个文件扫描后返回对象
func InitFileRes ¶
type ScanResult ¶
ScanFile 扫描后返回对象
func (*ScanResult) AddCounter ¶
func (result *ScanResult) AddCounter(counter *Counter)
func (*ScanResult) AddFileRes ¶
func (result *ScanResult) AddFileRes(res *FileRes)
func (*ScanResult) ToJson ¶
func (result *ScanResult) ToJson() string
type StringArray ¶
type StringArray []string
func (*StringArray) Set ¶
func (a *StringArray) Set(s string)
func (*StringArray) String ¶
func (a *StringArray) String() string
Click to show internal directories.
Click to hide internal directories.