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

Commit

Permalink
feat: try to integrate StackHead method proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
saitho committed Sep 26, 2021
1 parent df344d8 commit b205ed3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
13 changes: 13 additions & 0 deletions install.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package pluginlib

type PackageName struct {
ApkPackageName string
}

func InstallPackage(packageName PackageName) <-chan error {
return StackHeadMain.Execute(IntCmdInstallPkgApk, packageName.ApkPackageName)
}

func UninstallPackage(packageName PackageName) <-chan error {
return StackHeadMain.Execute(IntCmdUninstallPkgApk, packageName.ApkPackageName)
}
6 changes: 3 additions & 3 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
)

type Plugin interface {
Setup()
Deploy(project Project)
Destroy(project Project)
Setup() <-chan error
Deploy(project Project) <-chan error
Destroy(project Project) <-chan error
TriggerHook(hookName string, project Project)
}

Expand Down
12 changes: 12 additions & 0 deletions stackhead.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package pluginlib

type IStackHeadMain interface {
Execute(command string, args ...interface{}) <-chan error
}

const (
IntCmdInstallPkgApk string = "stackhead:install:package:apk"
IntCmdUninstallPkgApk string = "stackhead:uninstall:package:apk"
)

var StackHeadMain IStackHeadMain = nil

0 comments on commit b205ed3

Please sign in to comment.