bufimagebuild

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: 22 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

This section is empty.

Types

type BuildOption

type BuildOption func(*buildOptions)

BuildOption is an option for Build.

func WithExcludeSourceCodeInfo

func WithExcludeSourceCodeInfo() BuildOption

WithExcludeSourceCodeInfo returns a BuildOption that excludes sourceCodeInfo.

func WithExpectedDirectDependencies

func WithExpectedDirectDependencies(expectedDirectDependencies []bufmoduleref.ModuleReference) BuildOption

WithExpectedDirectDependencies sets the module dependencies that are expected, usually because they are in a configuration file (buf.yaml). If the build detects that there are direct dependencies outside of this list, a warning will be printed.

func WithWorkspace

func WithWorkspace(workspace bufmodule.Workspace) BuildOption

WithWorkspace sets the workspace to be read from instead of ModuleReader, and to not warn imports for.

TODO: this can probably be dealt with by finding out if an ImageFile has a commit or not, although that is hacky, that's an implementation detail in practice, but perhaps we could justify it - transitive dependencies without commits don't make sense?

TODO: shouldn't buf.yamls in workspaces have deps properly declared in them anyways? Why not warn?

type Builder

type Builder interface {
	// Build runs compilation.
	//
	// The FileRefs are assumed to have been created by a FileRefProvider, that is
	// they are unique relative to the roots.
	//
	// If an error is returned, it is a system error.
	// Only one of Image and FileAnnotations will be returned.
	//
	// FileAnnotations will use external file paths.
	Build(
		ctx context.Context,
		module bufmodule.Module,
		options ...BuildOption,
	) (bufimage.Image, []bufanalysis.FileAnnotation, error)
}

Builder builds Protobuf files into Images.

func NewBuilder

func NewBuilder(logger *zap.Logger, moduleReader bufmodule.ModuleReader) Builder

NewBuilder returns a new Builder.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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