Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoProjectDetected = errors.New("no project detected")
ErrNoProjectDetected is returned when no registered detector finds a project.
Functions ¶
This section is empty.
Types ¶
type Detector ¶
type Detector interface {
Detect(path string) (*ProjectInfo, error)
}
Detector detects project info from a directory (e.g. by parsing manifest files). Success: return (info, nil) with non-empty info.Name. Not applicable / no manifest: return (nil, nil). Error: return (nil, err); registry skips and tries next (best-effort).
type ProjectInfo ¶
type ProjectInfo struct {
Name string
}
ProjectInfo holds detected project metadata (extensible).
func DetectProject ¶
func DetectProject(path string) (*ProjectInfo, error)
DetectProject detects project name from the given directory path using all registered detectors. Returns the first successful result, or (nil, ErrNoProjectDetected) when no detector finds a project.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds an ordered list of detectors; first success wins.