builder

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 25 Imported by: 1 module, 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

Overview

Package builder assembles a custom RoadRunner binary from the downloaded source tree and the user plugin set.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder turns a downloaded RoadRunner source tree and a user plugin set into a custom binary.

func NewBuilder

func NewBuilder(rrTmpPath string, opts ...Option) *Builder

NewBuilder creates a Builder rooted at the directory holding the downloaded RoadRunner source tree.

func (*Builder) Build

func (b *Builder) Build(ctx context.Context) (string, error)

Build runs the whole pipeline and returns the path of the binary in the output directory.

type Option

type Option func(*Builder)

Option configures a Builder and is passed to NewBuilder.

func WithDebug

func WithDebug(debug bool) Option

WithDebug toggles the debug build profile (no inlining, no optimization, debug tag).

func WithExcludes

func WithExcludes(es []velox.Exclude) Option

WithExcludes sets the go.mod exclude directives to apply before tidy.

func WithGOARCH

func WithGOARCH(goarch string) Option

WithGOARCH sets the target GOARCH for cross-compilation.

func WithGOOS

func WithGOOS(goos string) Option

WithGOOS sets the target GOOS for cross-compilation.

func WithLogger

func WithLogger(log *slog.Logger) Option

WithLogger sets the builder logger and ignores a nil value so the discard default survives.

func WithOutputDir

func WithOutputDir(outputDir string) Option

WithOutputDir sets the directory where the final binary is placed.

func WithPlugins

func WithPlugins(plugins ...*plugin.Plugin) Option

WithPlugins sets the plugins to include in the binary.

func WithRRVersion

func WithRRVersion(rrVersion string) Option

WithRRVersion sets the RoadRunner ref that fills the `-X meta.version` ldflag.

func WithRace

func WithRace(race bool) Option

WithRace toggles `-race` (forces CGO_ENABLED=1).

func WithReplaces

func WithReplaces(rs []velox.Replace) Option

WithReplaces sets the go.mod replace directives to apply before tidy.

Directories

Path Synopsis
Package templates renders the generated container/plugins.go that registers the RoadRunner plugins.
Package templates renders the generated container/plugins.go that registers the RoadRunner plugins.

Jump to

Keyboard shortcuts

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