scanner

package
v0.0.0-...-f61b284 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WalkFiles

func WalkFiles(root string, f func(string, fs.DirEntry) error) error

WalkFiles WalkDir is similar to filepath.WalkDir(), but processes files before directories at each directory level.

Types

type DoScanFunc

type DoScanFunc func(path string) bool

type File

type File interface {
	Fullpath() string
	SourceDir() string
	RelPath() string
	RelDir(string) (string, bool)
	Filename() string
}

func NewFile

func NewFile(path string, sourceDir *string) File

type Files

type Files []File

type FilesMap

type FilesMap map[string]File

type ScanMode

type ScanMode int

type Scanner

type Scanner struct {
	DoScanFunc DoScanFunc
	ScanMode   ScanMode
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(srcDir string) *Scanner

func NewScannerWithFunc

func NewScannerWithFunc(srcDir string, f DoScanFunc) *Scanner

func (*Scanner) AddFile

func (s *Scanner) AddFile(file File)

func (*Scanner) Scan

func (s *Scanner) Scan(ctx context.Context, match *regexp.Regexp) (_ Files, err error)

func (*Scanner) ScanChan

func (s *Scanner) ScanChan(ctx context.Context, match *regexp.Regexp, ch chan<- File) (err error)

Jump to

Keyboard shortcuts

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