Skip to main content

Module platform

Module platform 

Source
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§

PluginFile

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; None when 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.GOARCH for this build.
goos
Go runtime.GOOS for this build.
rel
Go filepath.Rel (Unix rules): targ relative to base, both cleaned first; None when one is absolute and the other is not, or base climbs past targ. 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.+-]*$.