Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoProtoFiles = SourceError("no .proto files found")
ErrNoProtoFiles is returned when a directory scan finds no .proto files.
Functions ¶
This section is empty.
Types ¶
type ScanResult ¶
type ScanResult struct {
// Files contains relative proto file paths suitable for protocompile input.
Files []string
// ImportPath is the absolute, cleaned input directory used as the import root.
ImportPath string
}
ScanResult holds the discovered proto files and the resolved import path.
func Scan ¶
func Scan(inputDir string) (ScanResult, error)
Scan discovers all .proto files under inputDir and returns them in stable lexicographic order. The inputDir is resolved to an absolute path and used as the single import root for protocompile.
Scan rejects paths that escape the input directory (e.g. symlinks pointing outside) and returns an error if inputDir does not exist or is not a directory.
type SourceError ¶ added in v0.3.0
SourceError is the sentinel error type for source-package errors. Use errors.As(err, new(source.SourceError)) to match any source-package error.
Click to show internal directories.
Click to hide internal directories.