Udpated winrmcp dep
This commit is contained in:
parent
2970038204
commit
ab36418729
|
@ -4,6 +4,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
@ -24,6 +25,7 @@ type Config struct {
|
||||||
CACertBytes []byte
|
CACertBytes []byte
|
||||||
OperationTimeout time.Duration
|
OperationTimeout time.Duration
|
||||||
MaxOperationsPerShell int
|
MaxOperationsPerShell int
|
||||||
|
TransportDecorator func(*http.Transport) http.RoundTripper
|
||||||
}
|
}
|
||||||
|
|
||||||
type Auth struct {
|
type Auth struct {
|
||||||
|
@ -41,6 +43,10 @@ func New(addr string, config *Config) (*Winrmcp, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
params := winrm.DefaultParameters()
|
params := winrm.DefaultParameters()
|
||||||
|
if config.TransportDecorator != nil {
|
||||||
|
params.TransportDecorator = config.TransportDecorator
|
||||||
|
}
|
||||||
|
|
||||||
if config.OperationTimeout.Seconds() > 0 {
|
if config.OperationTimeout.Seconds() > 0 {
|
||||||
params.Timeout = iso8601.FormatDuration(config.OperationTimeout)
|
params.Timeout = iso8601.FormatDuration(config.OperationTimeout)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue