workspaceindex

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package workspaceindex provides shared deterministic workspace scanning primitives for repo intelligence, tools, and context accounting.

Index

Constants

View Source
const (
	DefaultMaxFiles = 2000
	DefaultMaxDepth = 6
)

Variables

This section is empty.

Functions

func FileDepth

func FileDepth(rel string) int

func HandleWalkError

func HandleWalkError(cleanRoot string, current string, entry fs.DirEntry, walkErr error, truncated *bool) (bool, error)

func ImportantPriority

func ImportantPriority(file string) (int, bool)

func IsImportantPath

func IsImportantPath(file string) bool

func LanguageForPath

func LanguageForPath(file string) string

func LooksBinaryPath

func LooksBinaryPath(file string) bool

func PathDepth

func PathDepth(rel string) int

func ShouldSkipDir

func ShouldSkipDir(name string) bool

func ShouldSkipFile

func ShouldSkipFile(rel string) bool

func SortFiles

func SortFiles(files []File)

Types

type File

type File struct {
	Path      string
	Name      string
	Ext       string
	Language  string
	Size      int64
	Depth     int
	Important bool
}

type Options

type Options struct {
	MaxFiles int
	// MaxDepth is measured as path separators below the root. Zero means root
	// files only; negative values use DefaultMaxDepth.
	MaxDepth            int
	MaxBytesPerFileName int
}

type Summary

type Summary struct {
	Root            string
	Files           []File
	LanguageCounts  map[string]int
	ExtensionCounts map[string]int
	TotalFiles      int
	DirectoryCount  int
	MaxDepth        int
	Truncated       bool
}

func Scan

func Scan(root string, options Options) (Summary, error)

Jump to

Keyboard shortcuts

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