source

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 6 Imported by: 0

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

type SourceError = errorx.Sentinel[sourceTag]

SourceError is the sentinel error type for source-package errors. Use errors.As(err, new(source.SourceError)) to match any source-package error.

Jump to

Keyboard shortcuts

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