file

package
v0.0.0-...-1d6347e Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScanFiles

func ScanFiles(filePaths []string, m, ig *regexp.Regexp,
	beforeFn BeforeScanFunc, afterFn AfterScanFunc) <-chan *File

ScanFiles .

Types

type AfterScanFunc

type AfterScanFunc func(path string)

AfterScanFunc .

type BeforeScanFunc

type BeforeScanFunc func(path string)

BeforeScanFunc .

type File

type File struct {
	// contains filtered or unexported fields
}

File finds and stores the line matching the specified regular expression.

func (*File) Error

func (f *File) Error() error

Error returns an error scanned file.

func (*File) MatchedLines

func (f *File) MatchedLines() map[int][]byte

MatchedLines returns the result of Scan.

func (*File) Path

func (f *File) Path() string

Path returns a file path.

func (*File) Scan

func (f *File) Scan()

Scan checks the contents of the file line by line to see if it matches the regular expression. When it finds a line that matches the regular expression, it stores the contents of the line with the line number.

type Heap

type Heap []*File

Heap is a data type for sorting the file list in ascending order by name.

func (Heap) Len

func (h Heap) Len() int

func (Heap) Less

func (h Heap) Less(i, j int) bool

func (*Heap) Pop

func (h *Heap) Pop() interface{}

Pop .

func (Heap) Print

func (h Heap) Print()

Print is prints data of Heap.

func (*Heap) Push

func (h *Heap) Push(x interface{})

Push .

func (Heap) Swap

func (h Heap) Swap(i, j int)

Jump to

Keyboard shortcuts

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