This commit is contained in:
@@ -17,13 +17,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CommanderClient struct {
|
type CommanderClient struct {
|
||||||
cmder *commander.Commander
|
cmder *commander.CommandExecutor
|
||||||
wg *sync.WaitGroup
|
wg *sync.WaitGroup
|
||||||
id string
|
id string
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(
|
func New(
|
||||||
cmder *commander.Commander,
|
cmder *commander.CommandExecutor,
|
||||||
wg *sync.WaitGroup,
|
wg *sync.WaitGroup,
|
||||||
id string,
|
id string,
|
||||||
) CommanderClient {
|
) CommanderClient {
|
||||||
@@ -10,10 +10,10 @@ import (
|
|||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Commander struct {
|
type CommandExecutor struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*Commander) Execute(command *proto.Command) (*proto.FinishedCommand, error) {
|
func (*CommandExecutor) Execute(command *proto.Command) (*proto.FinishedCommand, error) {
|
||||||
cmd := exec.Command(command.Command[0], command.Command[1:]...)
|
cmd := exec.Command(command.Command[0], command.Command[1:]...)
|
||||||
var (
|
var (
|
||||||
stdin io.WriteCloser
|
stdin io.WriteCloser
|
||||||
|
|||||||
Reference in New Issue
Block a user