Expand description
Plugin file discovery and selection (internal/pluginhost/platform.go).
Files are <id>.<ext> or <id>-v<version>.<ext> in <dir>/<goos>/<goarch> and then
<dir>. The first directory to name an ID fixes its position; later files for the
same ID replace the selection only when preferred (the desired version, else the
higher version).
Structs§
Functions§
- candidate_
dirs - Go
candidateDirs. - clean
- Go
filepath.Clean. - cleanup_
unselected - Go
cleanupUnselectedPluginFiles: removes other versions of plugins that loaded. - compare_
versions - Go
comparePluginVersions: dot-separated non-negative integers;Nonewhen either side has a non-numeric segment. Missing segments count as 0. - discover
- Go
selectPluginFiles/DiscoverPluginFiles. - extension
- Go
PluginExtension. - file_
from_ path - Go
pluginFileFromPath. - goarch
- Go
runtime.GOARCHfor this build. - goos
- Go
runtime.GOOSfor this build. - rel
- Go
filepath.Rel(Unix rules):targrelative tobase, both cleaned first;Nonewhen one is absolute and the other is not, orbaseclimbs pasttarg. ponytail: Windows volume names and case-insensitive elements are not handled; the plugin host only loads native plugins on Unix. - select_
with_ candidates - Go
selectPluginFilesWithCandidates: the selected file per ID (in first-seen order) and every candidate. An ID whose desired version has no file is not selected. - valid_
id - Go
pluginIDPattern:^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$. - valid_
version - Go
validPluginVersion:^[0-9][0-9A-Za-z.+-]*$.