Documentation
¶
Overview ¶
Package scanner discovers environment files under user-chosen roots.
It never walks the whole filesystem: callers pass explicit roots, and well-known dependency/cache directories are pruned.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultExcludes = []string{
".git", "node_modules", "vendor", ".cache", "Library",
"dist", "build", ".next", ".nuxt", ".turbo", ".venv", "venv",
"__pycache__", ".terraform", ".gradle", "target", ".idea", ".vscode",
}
DefaultExcludes are directory names that are never descended into.
Functions ¶
func IsEnvFile ¶
IsEnvFile reports whether a file name looks like an environment file: .env, .env.<anything>, env, env.<anything>.
func IsTemplate ¶
IsTemplate reports whether the env file is an example/template file.
Types ¶
type Options ¶
type Options struct {
Excludes []string // directory names to prune; nil means DefaultExcludes
IncludeTemplate bool // include .env.example & friends
MaxFileSize int64 // skip larger files; 0 means 1 MiB
}
Options configures a scan.
type Result ¶
type Result struct {
Path string `json:"path"` // absolute path
Root string `json:"root"` // scan root it was found under
RelPath string `json:"rel_path"` // path relative to Root
ProjectDir string `json:"project_dir"` // git root, else containing dir
ProjectName string `json:"project_name"` // base name of ProjectDir
InGitRepo bool `json:"in_git_repo"`
IsTemplate bool `json:"is_template"`
Size int64 `json:"size"`
}
Result is a discovered environment file.
Click to show internal directories.
Click to hide internal directories.