Help us shape the future of Go! Take the 2026 Go Developer Survey

compile

package
v0.510.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Overview

Package compile compiles FTL Go module source into a deployable executable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(ctx context.Context, projectConfig projectconfig.Config, stubsRoot string, config moduleconfig.AbsModuleConfig,
	sch *schema.Schema, deps, buildEnv []string, filesTransaction watch.ModifyFilesTransaction, ongoingState *OngoingState,
	devMode bool) (moduleSch optional.Option[*schema.Module], invalidateDeps bool, buildErrors []builderrors.Error)

Build the given module.

func ExtractDependencies

func ExtractDependencies(config moduleconfig.AbsModuleConfig) ([]string, error)

func GenerateStubs

func GenerateStubs(ctx context.Context, dir string, moduleSch *schema.Module, config moduleconfig.AbsModuleConfig, nativeConfig optional.Option[moduleconfig.AbsModuleConfig]) error

func SyncGeneratedStubReferences

func SyncGeneratedStubReferences(ctx context.Context, config moduleconfig.AbsModuleConfig, stubsDir string, stubbedModules []string) error

Types

type ExternalDeploymentContext

type ExternalDeploymentContext struct {
	GoVersion    string
	FTLVersion   string
	Module       *schema.Module
	Replacements []*modfile.Replace
}

type MainWorkContext

type MainWorkContext struct {
	GoVersion          string
	SharedModulesPaths []string
	IncludeMainPackage bool
}

type OngoingState

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

OngoingState maintains state between builds, allowing the Build function to skip steps if nothing has changed.

func (*OngoingState) DetectedFileChanges

func (s *OngoingState) DetectedFileChanges(config moduleconfig.AbsModuleConfig, changes []watch.FileChange)

DetectedFileChanges should be called whenever file changes are detected outside of the Build() function. This allows the OngoingState to detect if files need to be reprocessed.

func (*OngoingState) IsEmpty added in v0.460.0

func (s *OngoingState) IsEmpty() bool

IsEmpty returns true if the OngoingState is in its initial/reset state

Jump to

Keyboard shortcuts

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