Documentation
¶
Overview ¶
Package solver implements constraint solving for Minecraft plugin version compatibility.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SimpleSolver ¶
type SimpleSolver struct{}
SimpleSolver implements a linear search constraint solver for MVP. Per ADR-010, this is sufficient for small numbers of plugins/servers.
func NewSimpleSolver ¶
func NewSimpleSolver() *SimpleSolver
NewSimpleSolver creates a new simple linear search solver.
func (*SimpleSolver) FindBestPaperVersion ¶
func (s *SimpleSolver) FindBestPaperVersion( ctx context.Context, server *mcv1beta1.PaperMCServer, matchedPlugins []mcv1beta1.Plugin, paperVersions []string, ) (string, error)
FindBestPaperVersion finds the maximum Paper version compatible with ALL plugins. Algorithm:
- Handle strategy-specific logic (pin/build-pin return exact version)
- Filter Paper versions by updateDelay
- Sort versions in descending order
- For each Paper version (highest first), check if ALL plugins have a compatible version
- Return first Paper version that satisfies all constraints
func (*SimpleSolver) FindBestPluginVersion ¶
func (s *SimpleSolver) FindBestPluginVersion( ctx context.Context, plugin *mcv1beta1.Plugin, servers []mcv1beta1.PaperMCServer, allVersions []plugins.PluginVersion, ) (string, error)
FindBestPluginVersion finds the maximum plugin version compatible with ALL servers. Algorithm:
- Handle strategy-specific logic (pin/build-pin return exact version)
- Filter versions by updateDelay (skip too new versions)
- Sort versions in descending order
- For each version (highest first), check if compatible with ALL servers
- Return first version that satisfies all constraints
type Solver ¶
type Solver interface {
// FindBestPluginVersion finds the maximum plugin version compatible with ALL matched servers.
// This implements the constraint: ∀ server ∈ servers: compatible(plugin_version, server.paperVersion).
FindBestPluginVersion(
ctx context.Context,
plugin *mcv1beta1.Plugin,
servers []mcv1beta1.PaperMCServer,
allVersions []plugins.PluginVersion,
) (string, error)
// FindBestPaperVersion finds the maximum Paper version compatible with ALL matched plugins.
// This implements the constraint: ∀ plugin ∈ plugins: ∃ plugin_version compatible with paper_version.
FindBestPaperVersion(
ctx context.Context,
server *mcv1beta1.PaperMCServer,
matchedPlugins []mcv1beta1.Plugin,
paperVersions []string,
) (string, error)
}
Solver defines the interface for finding compatible versions. Implementations include simple linear search (MVP) and future SAT-based solvers.
Click to show internal directories.
Click to hide internal directories.