builder

package
v1.15.1-0...-8034b25 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package builder is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ErrUndefinedEnvVariable = errors.New("environment variable is undefined or empty")

ErrUndefinedEnvVariable occurs when requested environment variable is undefined or empty

Functions

func GOROOT

func GOROOT() (string, error)

GOROOT returns host GOROOT variable from OS environment vars or from Go tool environment.

func IsBuildError

func IsBuildError(err error) bool

func LookupEnv

func LookupEnv(ctx context.Context, varName string) (string, error)

LookupEnv gets variable by name from shell environment or using Go environment using "go env" tool.

Types

type BuildEnvironmentConfig

type BuildEnvironmentConfig struct {
	// IncludedEnvironmentVariables is a list included environment variables for build.
	IncludedEnvironmentVariables osutil.EnvironmentVariables

	// KeepGoModCache disables Go modules cache cleanup.
	KeepGoModCache bool
}

BuildEnvironmentConfig is BuildService environment configuration.

type BuildError

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

BuildError is build error

func (*BuildError) Error

func (e *BuildError) Error() string

Error implements error

type BuildService

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

BuildService is WASM build service

func NewBuildService

func NewBuildService(log *zap.Logger, cfg BuildEnvironmentConfig, store storage.StoreProvider) BuildService

NewBuildService is BuildService constructor

func (BuildService) Build

func (s BuildService) Build(ctx context.Context, files map[string][]byte) (*Result, error)

Build compiles Go source to WASM and returns result

func (BuildService) Clean

func (s BuildService) Clean(ctx context.Context) error

Clean implements' builder.Cleaner interface.

Cleans go build and modules cache.

func (BuildService) CleanJobName

func (s BuildService) CleanJobName() string

CleanJobName implements' builder.Cleaner interface.

func (BuildService) GetArtifact

GetArtifact returns artifact by id

type Cleaner

type Cleaner interface {
	CleanJobName() string
	Clean(ctx context.Context) error
}

type CleanupDispatchService

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

CleanupDispatchService calls cleanup entries after periodical interval of time.

func NewCleanupDispatchService

func NewCleanupDispatchService(logger *zap.Logger, interval time.Duration, cleaners ...Cleaner) *CleanupDispatchService

func (*CleanupDispatchService) Start

func (c *CleanupDispatchService) Start(ctx context.Context)

type CommandRunner

type CommandRunner interface {
	RunCommand(cmd *exec.Cmd) error
}

CommandRunner is abstract command cmdRunner.

type MockCommandRunner

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

MockCommandRunner is a mock of CommandRunner interface.

func NewMockCommandRunner

func NewMockCommandRunner(ctrl *gomock.Controller) *MockCommandRunner

NewMockCommandRunner creates a new mock instance.

func (*MockCommandRunner) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCommandRunner) RunCommand

func (m *MockCommandRunner) RunCommand(arg0 *exec.Cmd) error

RunCommand mocks base method.

type MockCommandRunnerMockRecorder

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

MockCommandRunnerMockRecorder is the mock recorder for MockCommandRunner.

func (*MockCommandRunnerMockRecorder) RunCommand

func (mr *MockCommandRunnerMockRecorder) RunCommand(arg0 any) *gomock.Call

RunCommand indicates an expected call of RunCommand.

type OSCommandRunner

type OSCommandRunner struct{}

func (OSCommandRunner) RunCommand

func (OSCommandRunner) RunCommand(cmd *exec.Cmd) error

type Result

type Result struct {
	// FileName is artifact file name
	FileName string

	// IsTest indicates whether binary is a test file
	IsTest bool

	// HasBenchmark indicates whether test contains benchmarks.
	HasBenchmark bool

	// HasFuzz indicates whether test has fuzzing tests.
	HasFuzz bool
}

Result is WASM build result

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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