shell/linux/interface.go

36 lines
769 B
Go
Raw Normal View History

2024-07-04 22:40:13 +02:00
package linux
import (
"errors"
"io"
"sync"
2024-07-04 22:40:13 +02:00
)
type LinuxCommand struct {
Options CommandOptions
handlers map[int]interface{}
wg sync.WaitGroup
stdout io.ReadCloser
stderr io.ReadCloser
stdin io.WriteCloser
2024-07-04 22:40:13 +02:00
}
type CommandOptions struct {
2024-07-05 01:40:33 +02:00
Env map[string]string
Sources []string
Command string
Args []string
CustomErrors map[int8]error
Cwd string
Shell string
2024-07-04 22:40:13 +02:00
}
// Errors
var (
2024-07-04 23:14:10 +02:00
ErrFetchingCwd = errors.New("error fetching cwd")
ErrRunningCmd = errors.New("error running command")
ErrCommandNotFound = errors.New("error command not found")
ErrCommandNotExecutable = errors.New("error command not executable")
ErrInvalidHandler = errors.New("invalid handler")
2024-07-04 22:40:13 +02:00
)