builder

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package builder implements a build service

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAccessingArtifact     = errors.New("accessing artifact") //nolint:revive
	ErrBuildingArtifact      = errors.New("building artifact")
	ErrInitializingBuilder   = errors.New("initializing builder")
	ErrInvalidParameters     = errors.New("invalid build parameters")
	ErrBuildSemverNotAllowed = errors.New("semvers with build metadata not allowed")
)

Functions

This section is empty.

Types

type Builder

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

Builder implements the BuildService interface

func New

func New(_ context.Context, config Config) (*Builder, error)

New returns a new instance of Builder given a BuilderConfig

func (*Builder) Build

func (b *Builder) Build(
	ctx context.Context,
	platform string,
	k6Constrains string,
	deps []k6build.Dependency,
) (artifact k6build.Artifact, buildErr error)

Build builds a custom k6 binary with dependencies

type Config

type Config struct {
	Opts       Opts
	Catalog    string
	Store      store.ObjectStore
	Foundry    FoundryFactory
	Registerer prometheus.Registerer
}

Config defines the configuration for a Builder

type FoundryFactory added in v0.5.5

type FoundryFactory interface {
	NewFoundry(ctx context.Context, opts k6foundry.NativeFoundryOpts) (k6foundry.Foundry, error)
}

FoundryFactory is a function that creates a FoundryFactory

type FoundryFactoryFunction added in v0.5.5

type FoundryFactoryFunction func(context.Context, k6foundry.NativeFoundryOpts) (k6foundry.Foundry, error)

FoundryFactoryFunction defines a function that implements the FoundryFactory interface

func (FoundryFactoryFunction) NewFoundry added in v0.5.5

NewFoundry implements the Foundry interface

type GoOpts

type GoOpts = k6foundry.GoOpts

GoOpts defines the options for the go build environment

type Opts

type Opts struct {
	// Allow semvers with build metadata
	AllowBuildSemvers bool
	// Generate build output
	Verbose bool
	// Build environment options
	GoOpts
}

Opts defines the options for configuring the builder

Jump to

Keyboard shortcuts

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