engine

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package engine manages the CLI engine binaries that carry out run operations.

Index

Constants

View Source
const MinEngineVersion = "1.2.0"

MinEngineVersion specifies the minimum engine version accepted by OTF.

TODO: This originally applied only to terraform before tofu was added as an alternative engine. Tofu's earliest version is 1.6.0, which should really be the minimum version if tofu is the selected engine.

Variables

View Source
var (
	// Default is the default for setting the default engine.
	//
	// NOTE: the actual default engine that has been set by the user should be
	// retrieved via the daemon config.
	Default = Terraform
	// Terraform is the terraform engine
	Terraform = &Engine{engine: &terraform{}}
	// Tofu is the opentofu engine
	Tofu = &Engine{engine: &tofu{}}
	// ErrInvalidVersion is returned when a engine version string is
	// not a semantic version string (major.minor.patch).
	ErrInvalidVersion = errors.New("invalid engine version")
)
View Source
var DefaultBinDir = path.Join(os.TempDir(), "otf-engine-bins")

Functions

func NewDownloader added in v0.3.21

func NewDownloader(engine engineSource, destdir string) *downloader

NewDownloader constructs a terraform downloader, with destdir set as the parent directory into which the binaries are downloaded. Pass an empty string to use a default.

Types

type DB added in v0.3.21

type DB interface {
	// contains filtered or unexported methods
}

type Engine

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

func Engines added in v0.3.21

func Engines() []*Engine

func (*Engine) MarshalText

func (e *Engine) MarshalText() ([]byte, error)

func (*Engine) Scan

func (e *Engine) Scan(text any) error

func (*Engine) Set

func (e *Engine) Set(v string) error

func (*Engine) Type

func (*Engine) Type() string

func (*Engine) UnmarshalText

func (e *Engine) UnmarshalText(text []byte) error

func (*Engine) Value

func (e *Engine) Value() (driver.Value, error)

type Options added in v0.3.21

type Options struct {
	logr.Logger
	*sql.DB

	BinDir string // destination directory for binaries
}

type Service added in v0.3.21

type Service struct {
	logr.Logger
	// contains filtered or unexported fields
}

func NewService added in v0.3.21

func NewService(opts Options) *Service

func (*Service) GetLatest added in v0.3.21

func (s *Service) GetLatest(ctx context.Context, engine *Engine) (string, time.Time, error)

GetLatest returns the latest engine version and the time when it was fetched; if it has not yet been fetched then the default version is returned instead along with zero time.

func (*Service) StartLatestChecker added in v0.3.21

func (s *Service) StartLatestChecker(ctx context.Context)

StartLatestChecker starts the latest checker go routine, checking the latest version of each engine on a regular interval.

Jump to

Keyboard shortcuts

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