docformat

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxFileSizeByExt = map[string]int64{
	".md":   1_048_576,
	".docx": 10_485_760,
	".html": 5_242_880,
	".htm":  5_242_880,
	".pdf":  52_428_800,

	".go":     1_048_576,
	".py":     1_048_576,
	".rb":     1_048_576,
	".js":     1_048_576,
	".jsx":    1_048_576,
	".ts":     1_048_576,
	".tsx":    1_048_576,
	".svelte": 1_048_576,
	".vue":    1_048_576,
	".rs":     1_048_576,
	".c":      1_048_576,
	".cc":     1_048_576,
	".h":      1_048_576,
	".cpp":    1_048_576,
	".cxx":    1_048_576,
	".hpp":    1_048_576,
	".hh":     1_048_576,
	".java":   1_048_576,
	".swift":  1_048_576,
	".cs":     1_048_576,
	".php":    1_048_576,
	".kt":     1_048_576,
	".kts":    1_048_576,
	".dart":   1_048_576,
	".lua":    1_048_576,
	".luau":   1_048_576,
	".pas":    1_048_576,
	".pp":     1_048_576,
	".sql":    1_048_576,
	".liquid": 1_048_576,
}

MaxFileSizeByExt maps each supported extension to its physical-file size cap in bytes. Markdown keeps the historic 1 MB limit; binary formats allow larger physical files because compression ratios and per-format security guards (zip-bomb, page cap) are enforced inside the extractor.

Functions

func ReadFileCapped added in v0.3.0

func ReadFileCapped(path string, limit int64) ([]byte, error)

ReadFileCapped reads path fully into memory but returns an error if the file exceeds limit bytes. It bounds the live read with an io.LimitReader instead of trusting a scan-time size check, which is separated from the read by a TOCTOU window (and absent entirely on live, MCP-triggered reads). A non- positive limit reads the file with no cap.

func SupportedExt

func SupportedExt(ext string) bool

SupportedExt reports whether the lower-cased file extension is handled by DocGraph's indexing pipeline.

Types

This section is empty.

Jump to

Keyboard shortcuts

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