forked from cli/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextension.go
More file actions
36 lines (30 loc) · 888 Bytes
/
extension.go
File metadata and controls
36 lines (30 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package extensions
import (
"io"
"github.com/cli/cli/v2/internal/ghrepo"
)
type ExtTemplateType int
const (
GitTemplateType ExtTemplateType = 0
GoBinTemplateType ExtTemplateType = 1
OtherBinTemplateType ExtTemplateType = 2
)
//go:generate moq -rm -out extension_mock.go . Extension
type Extension interface {
Name() string // Extension Name without gh-
Path() string // Path to executable
URL() string
IsLocal() bool
UpdateAvailable() bool
IsBinary() bool
}
//go:generate moq -rm -out manager_mock.go . ExtensionManager
type ExtensionManager interface {
List(includeMetadata bool) []Extension
Install(ghrepo.Interface) error
InstallLocal(dir string) error
Upgrade(name string, force bool) error
Remove(name string) error
Dispatch(args []string, stdin io.Reader, stdout, stderr io.Writer) (bool, error)
Create(name string, tmplType ExtTemplateType) error
}