Divided the execution between local and container and created an interface responsible for preparing and launching the execution

This commit is contained in:
pb
2025-04-25 11:14:54 +02:00
parent b43cb6d758
commit 90fa0b8edd
5 changed files with 237 additions and 52 deletions

21
daemons/interface.go Normal file
View 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)
}
}