bufmoduleprotocompile

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileAnnotation

func GetFileAnnotation(
	ctx context.Context,
	parserAccessorHandler ParserAccessorHandler,
	errorWithPos reporter.ErrorWithPos,
) (bufanalysis.FileAnnotation, error)

GetFileAnnotation gets the FileAnnotation for the ErrorWithPos error.

func GetFileAnnotations

func GetFileAnnotations(
	ctx context.Context,
	parserAccessorHandler ParserAccessorHandler,
	errorsWithPos []reporter.ErrorWithPos,
) ([]bufanalysis.FileAnnotation, error)

GetFileAnnotations gets the FileAnnotations for the ErrorWithPos errors.

Types

type ParserAccessorHandler

type ParserAccessorHandler interface {
	// Open opens the given path, and tracks the external path and import status.
	//
	// This function can be used as the accessor function for a protocompile.SourceResolver.
	Open(path string) (io.ReadCloser, error)
	// ExternalPath returns the external path for the input path.
	//
	// Returns the input path if the external path is not known.
	ExternalPath(path string) string
	// ModuleIdentity returns nil if not available.
	ModuleIdentity(path string) bufmoduleref.ModuleIdentity
	// Commit returns empty if not available.
	Commit(path string) string
}

ParserAccessorHandler handles source file access operations for protocompile.

func NewParserAccessorHandler

func NewParserAccessorHandler(ctx context.Context, moduleFileSet bufmodule.ModuleFileSet) ParserAccessorHandler

NewParserAccessorHandler returns a new ParserAccessorHandler.

TODO: make this dependent on whatever derivative getter type we create to replace ModuleFileSet.

Jump to

Keyboard shortcuts

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