From b205ed389965da8d923e89cebe07d0ae69a31085 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Sun, 26 Sep 2021 13:43:58 +0200 Subject: [PATCH] feat: try to integrate StackHead method proxy --- install.go | 13 +++++++++++++ plugin.go | 6 +++--- stackhead.go | 12 ++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 install.go create mode 100644 stackhead.go diff --git a/install.go b/install.go new file mode 100644 index 0000000..91e30ff --- /dev/null +++ b/install.go @@ -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) +} diff --git a/plugin.go b/plugin.go index 7278303..e2ab185 100644 --- a/plugin.go +++ b/plugin.go @@ -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) } diff --git a/stackhead.go b/stackhead.go new file mode 100644 index 0000000..aa79f46 --- /dev/null +++ b/stackhead.go @@ -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