[actions] handle errors via channel

This commit is contained in:
2023-10-30 19:59:21 +01:00
parent e9969abf1c
commit 737b90d597
5 changed files with 35 additions and 25 deletions

View File

@@ -8,13 +8,13 @@ import (
)
type Shutdown struct {
ActionChan chan bool
ActionChan ActionResultChan
}
func (s Shutdown) DryExecute() {
fmt.Println("Test Shutdown executed...")
s.ActionChan <- true
s.ActionChan <- nil
}
@@ -25,10 +25,10 @@ func (s Shutdown) Execute() {
fmt.Println("Shutdown executed...")
s.ActionChan <- true
s.ActionChan <- nil
}
func (s Shutdown) Create(config internal.ActionConfig, c chan bool) (Action, error) {
func (s Shutdown) Create(config internal.ActionConfig, c ActionResultChan) (Action, error) {
return Shutdown{c}, nil
}