buildtype

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package buildtype provides build type selection logic for different build strategies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsOCIEnforced

func IsOCIEnforced(strategy models.BuildStrategy) bool

IsOCIEnforced returns true if the strategy always produces OCI containers.

Types

type BuildTypeRecommendation

type BuildTypeRecommendation struct {
	Recommended models.BuildType `json:"recommended"`
	Reason      string           `json:"reason"`
	Alternative models.BuildType `json:"alternative,omitempty"`
	AltReason   string           `json:"alt_reason,omitempty"`
}

BuildTypeRecommendation contains build type recommendation with reasoning.

type DefaultSelector

type DefaultSelector struct{}

DefaultSelector is the default implementation of Selector.

func NewSelector

func NewSelector() *DefaultSelector

NewSelector creates a new DefaultSelector.

func (*DefaultSelector) GetRecommendation

func (s *DefaultSelector) GetRecommendation(strategy models.BuildStrategy, detection *models.DetectionResult) BuildTypeRecommendation

GetRecommendation returns the recommended build type with reasoning.

func (*DefaultSelector) SelectBuildType

func (s *DefaultSelector) SelectBuildType(strategy models.BuildStrategy, detection *models.DetectionResult, userPreference *models.BuildType) models.BuildType

SelectBuildType determines build type based on strategy and detection. Build type selection rules: - dockerfile strategy → ALWAYS oci - nixpacks strategy → ALWAYS oci - flake strategy → Based on flake outputs (user's flake determines type) - auto-go → PREFER pure-nix (smaller, faster), user can choose oci - auto-rust → PREFER pure-nix (smaller, faster), user can choose oci - auto-node → PREFER pure-nix for SSR apps, oci for complex native deps - auto-python → PREFER pure-nix, oci for complex native deps

type Selector

type Selector interface {
	// SelectBuildType determines build type based on strategy and detection.
	// If userPreference is provided, it will be used unless the strategy forces a specific type.
	SelectBuildType(strategy models.BuildStrategy, detection *models.DetectionResult, userPreference *models.BuildType) models.BuildType

	// GetRecommendation returns the recommended build type with reasoning.
	GetRecommendation(strategy models.BuildStrategy, detection *models.DetectionResult) BuildTypeRecommendation
}

Selector determines the appropriate build type for a strategy.

Jump to

Keyboard shortcuts

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