scan

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LanguageForPath

func LanguageForPath(path string) string

Types

type File

type File struct {
	Path     string    `json:"path"`
	AbsPath  string    `json:"-"`
	Language string    `json:"language"`
	Size     int64     `json:"size"`
	Hash     string    `json:"hash"`
	ModTime  time.Time `json:"modifiedAt"`
}

type Ignored

type Ignored struct {
	Path   string `json:"path"`
	Reason string `json:"reason"`
}

type Options added in v0.2.7

type Options struct {
	HashCachePath string
	ForceHashing  bool
}

type Result

type Result struct {
	Root       string    `json:"root"`
	Files      []File    `json:"files"`
	Ignored    []Ignored `json:"ignored"`
	TotalBytes int64     `json:"totalBytes"`
}

func Scan

func Scan(root string, cfg config.Config) (Result, error)

func ScanWithOptions added in v0.2.7

func ScanWithOptions(root string, cfg config.Config, visit func(path string, files int), options Options) (Result, error)

ScanWithOptions scans root with optional, reconstructible file-hash caching. Callers that require a fresh content audit should use Scan or ScanWithProgress.

func ScanWithProgress added in v0.2.2

func ScanWithProgress(root string, cfg config.Config, visit func(path string, files int)) (Result, error)

ScanWithProgress scans root and reports each filesystem entry before it is inspected. The callback is optional and is intended for live CLI feedback.

Jump to

Keyboard shortcuts

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