9 // PluginMeta is metadata about a plugin, useful for launching the plugin
10 // and for understanding which plugins are available.
11 type PluginMeta struct {
12 // Name is the name of the plugin, e.g. as inferred from the plugin
13 // binary's filename, or by explicit configuration.
16 // Version is the semver version of the plugin, expressed as a string
17 // that might not be semver-valid.
20 // Path is the absolute path of the executable that can be launched
21 // to provide the RPC server for this plugin.
25 // SHA256 returns a SHA256 hash of the content of the referenced executable
26 // file, or an error if the file's contents cannot be read.
27 func (m PluginMeta) SHA256() ([]byte, error) {
28 f, err := os.Open(m.Path)
35 _, err = io.Copy(h, f)
40 return h.Sum(nil), nil