You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
394 B
Go
24 lines
394 B
Go
6 years ago
|
package manager
|
||
|
|
||
|
import (
|
||
|
"os/exec"
|
||
|
)
|
||
|
|
||
|
// Candidate represents a possible plugin candidate, for mocking purposes
|
||
|
type Candidate interface {
|
||
|
Path() string
|
||
|
Metadata() ([]byte, error)
|
||
|
}
|
||
|
|
||
|
type candidate struct {
|
||
|
path string
|
||
|
}
|
||
|
|
||
|
func (c *candidate) Path() string {
|
||
|
return c.path
|
||
|
}
|
||
|
|
||
|
func (c *candidate) Metadata() ([]byte, error) {
|
||
|
return exec.Command(c.path, MetadataSubcommandName).Output()
|
||
|
}
|