Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SearchOptions ¶
type SearchOptions struct {
// Items is a list of items to search.
Items []string
// Constraint is a version constraint to match.
Constraint string
// Extractor is a function to extract a version from an item.
Extractor VersionExtractor
// Descending is a flag to search in descending order.
Descending bool
}
SearchOptions is a set of options for the Search function.
type Version ¶
type Version []int
Version is a sequence of integers.
func Search ¶
func Search(opts SearchOptions) (itemFound string, versionFound Version, found bool)
Search searches for the best matching item in the list of items.
type VersionExtractor ¶ added in v0.1.1
VersionExtractor is a function to extract a version component from a string.
Click to show internal directories.
Click to hide internal directories.