refactor and testing
This commit is contained in:
parent
91c9de6e34
commit
c038774f2c
16 changed files with 445 additions and 195 deletions
|
|
@ -80,6 +80,7 @@ func New(logger *logrus.Logger, version string) *Agent {
|
|||
if len(ac.Proxy) > 0 {
|
||||
restyC.SetProxy(ac.Proxy)
|
||||
}
|
||||
|
||||
if len(ac.Cert) > 0 {
|
||||
restyC.SetRootCertificate(ac.Cert)
|
||||
}
|
||||
|
|
@ -137,22 +138,6 @@ func New(logger *logrus.Logger, version string) *Agent {
|
|||
}
|
||||
}
|
||||
|
||||
type CmdStatus struct {
|
||||
Status gocmd.Status
|
||||
Stdout string
|
||||
Stderr string
|
||||
}
|
||||
|
||||
type CmdOptions struct {
|
||||
Shell string
|
||||
Command string
|
||||
Args []string
|
||||
Timeout time.Duration
|
||||
IsScript bool
|
||||
IsExecutable bool
|
||||
Detached bool
|
||||
}
|
||||
|
||||
func (a *Agent) NewCMDOpts() *CmdOptions {
|
||||
return &CmdOptions{
|
||||
Shell: "/bin/bash",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue