selection

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package selection implements the candidate-selection seam: the pluggable answer to "which SHA is the candidate?", decoupled from the pin mechanism itself (which is uniform across all ref styles). v1 ships only TrackRef; a future SemverWindow strategy is a non-breaking addition behind the same Strategy interface.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedRef = errors.New("unsupported ref style for candidate selection")

ErrUnsupportedRef marks ref styles v1 cannot sequence (semver).

Functions

This section is empty.

Types

type Strategy

type Strategy interface {
	// TrackingRef maps a GitRepository ref spec to the advertised ref name to observe.
	TrackingRef(ref *sourcev1.GitRepositoryRef) (string, error)
	// Candidate selects the candidate SHA from an advertisement listing
	// (map of ref name → SHA, including peeled "<ref>^{}" entries).
	Candidate(advertised map[string]string, trackingRef string) (sha string, ok bool)
}

Strategy answers "which SHA is the candidate?"

func TrackRef

func TrackRef() Strategy

TrackRef is the v1 default and only strategy.

Jump to

Keyboard shortcuts

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