workspaceindex

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 6 Imported by: 0

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 MaxFileDepth

func MaxFileDepth(files []File) int

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