strategy

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package strategy provides functionality for managing tool installation strategies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Strategy

type Strategy string

Strategy represents the strategy for handling tool installation.

const (
	// None indicates no strategy, meaning no action will be taken if the tool already exists.
	None Strategy = "none"
	// Sync indicates that the tool should only be modified if different from the desired state.
	Sync Strategy = "sync"
	// Force indicates that the tool should be installed or updated regardless of its current state.
	Force Strategy = "force"
)

func (Strategy) String

func (s Strategy) String() string

func (Strategy) Sync

func (s Strategy) Sync(t Tool) result.Result

Sync checks if the tool should be synced based on the strategy and its current version. It compares the existing version with the desired version and returns an error if the tool is already up to date.

type Tool

type Tool interface {
	Exists() bool
	GetCurrentVersion() string
	GetStrategy() Strategy
	GetTargetVersion() string
}

Tool represents the interface required by the Strategy type.

Jump to

Keyboard shortcuts

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