Skip to content

Commit 54367b3

Browse files
committed
cli-plugins/manager: un-export "Candidate" interface
It is for internal use for mocking purposes, and is not part of any public interface / signature. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent f86ad2e commit 54367b3

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cli-plugins/manager/candidate.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ import (
66
"github.com/docker/cli/cli-plugins/metadata"
77
)
88

9-
// Candidate represents a possible plugin candidate, for mocking purposes
10-
type Candidate interface {
11-
Path() string
12-
Metadata() ([]byte, error)
13-
}
14-
159
type candidate struct {
1610
path string
1711
}

cli-plugins/manager/plugin.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,18 @@ type Plugin struct {
3131
ShadowedPaths []string `json:",omitempty"`
3232
}
3333

34+
// pluginCandidate represents a possible plugin candidate, for mocking purposes.
35+
type pluginCandidate interface {
36+
Path() string
37+
Metadata() ([]byte, error)
38+
}
39+
3440
// newPlugin determines if the given candidate is valid and returns a
3541
// Plugin. If the candidate fails one of the tests then `Plugin.Err`
3642
// is set, and is always a `pluginError`, but the `Plugin` is still
3743
// returned with no error. An error is only returned due to a
3844
// non-recoverable error.
39-
func newPlugin(c Candidate, cmds []*cobra.Command) (Plugin, error) {
45+
func newPlugin(c pluginCandidate, cmds []*cobra.Command) (Plugin, error) {
4046
path := c.Path()
4147
if path == "" {
4248
return Plugin{}, errors.New("plugin candidate path cannot be empty")

0 commit comments

Comments
 (0)