scanner

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEntryPoint

func GetEntryPoint(path string) (string, error)

GetEntryPoint validates a need-to-be-processed target and returns its absolute path

func Peek

func Peek(path string, displayLineNum bool) (string, error)

Peek reads a single file's content

func RegenerateDirectoryTree

func RegenerateDirectoryTree(scanResult *ScanResult) string

RegenerateDirectoryTree regenerates the directory tree from scan result

func Walk

func Walk(path string) (string, error)

Walk returns just the directory tree structure for a path

Types

type FileInfo

type FileInfo struct {
	Path         string
	RelativePath string
	IsDir        bool
	Size         int64
	Content      string
	ModTime      time.Time
	TokenCount   int
	Error        error
}

FileInfo represents a single file or directory

type ScanOptions

type ScanOptions struct {
	NoGitignore    bool
	DisplayLineNum bool
}

ScanOptions configures directory scanning

type ScanResult

type ScanResult struct {
	RootPath      string
	Files         []FileInfo
	DirectoryTree string
	TotalFiles    int
	TotalLines    int
	TotalTokens   int
	Errors        []string
}

ScanResult contains directory scan results

func ScanDirectory

func ScanDirectory(rootPath string) (*ScanResult, error)

ScanDirectory scans a directory recursively Ignores files/directories specified in .gitignore by default

func ScanDirectoryWithOptions

func ScanDirectoryWithOptions(rootPath string, options ScanOptions) (*ScanResult, error)

ScanDirectoryWithOptions scans a directory with custom options

Jump to

Keyboard shortcuts

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