Divided the execution between local and container and created an interface responsible for preparing and launching the execution
This commit is contained in:
21
daemons/interface.go
Normal file
21
daemons/interface.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package daemons
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"io"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
type Executor interface {
|
||||
PrepareMonitorExec() []string
|
||||
LaunchMonitor(args []string, l zerolog.Logger)
|
||||
}
|
||||
|
||||
func logExecution(reader io.ReadCloser, l zerolog.Logger) {
|
||||
scanner := bufio.NewScanner(reader)
|
||||
for scanner.Scan() {
|
||||
output := scanner.Text()
|
||||
l.Debug().Msg(output)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user