Skip to content
This repository was archived by the owner on May 14, 2022. It is now read-only.

Commit b205ed3

Browse files
committed
feat: try to integrate StackHead method proxy
1 parent df344d8 commit b205ed3

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

install.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package pluginlib
2+
3+
type PackageName struct {
4+
ApkPackageName string
5+
}
6+
7+
func InstallPackage(packageName PackageName) <-chan error {
8+
return StackHeadMain.Execute(IntCmdInstallPkgApk, packageName.ApkPackageName)
9+
}
10+
11+
func UninstallPackage(packageName PackageName) <-chan error {
12+
return StackHeadMain.Execute(IntCmdUninstallPkgApk, packageName.ApkPackageName)
13+
}

plugin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55
)
66

77
type Plugin interface {
8-
Setup()
9-
Deploy(project Project)
10-
Destroy(project Project)
8+
Setup() <-chan error
9+
Deploy(project Project) <-chan error
10+
Destroy(project Project) <-chan error
1111
TriggerHook(hookName string, project Project)
1212
}
1313

stackhead.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package pluginlib
2+
3+
type IStackHeadMain interface {
4+
Execute(command string, args ...interface{}) <-chan error
5+
}
6+
7+
const (
8+
IntCmdInstallPkgApk string = "stackhead:install:package:apk"
9+
IntCmdUninstallPkgApk string = "stackhead:uninstall:package:apk"
10+
)
11+
12+
var StackHeadMain IStackHeadMain = nil

0 commit comments

Comments
 (0)