Client structParametersParametersParameters.Dialfunc(network, addr string) (net.Conn, error)Parameters.EnvelopeSizeintParameters.LocalestringParameters.TimeoutstringParameters.TransportDecoratorfunc() Transporter CreateShell will create a WinRM Shell,
which is the prealable for running commands. NewShell will create a new WinRM Shell for the given shellID Run will run command on the the remote host, writing the process stdout and stderr to
the given writers. Note with this method it isn't possible to inject stdin.
Deprecated: use RunWithContext() RunPSWithContextWithString will basically wrap your code to execute commands in powershell.exe. Default RunWithString
runs commands in cmd.exe RunPSWithString will basically wrap your code to execute commands in powershell.exe. Default RunWithString
runs commands in cmd.exe
Deprecated: use RunPSWithContextWithString() RunWithContext will run command on the the remote host, writing the process stdout and stderr to
the given writers. Note with this method it isn't possible to inject stdin.
If the context is canceled, the remote command is canceled. RunWithContextWithInput will run command on the the remote host, writing the process stdout and stderr to
the given writers, and injecting the process stdin with the stdin reader.
If the context is canceled, the command on the remote machine is canceled.
Warning stdin (not stdout/stderr) are bufferized, which means reading only one byte in stdin will
send a winrm http packet to the remote host. If stdin is a pipe, it might be better for
performance reasons to buffer it.
If stdin is nil, this is equivalent to c.RunWithContext() RunWithContextWithString will run command on the the remote host, returning the process stdout and stderr
as strings, and using the input stdin string as the process input
If the context is canceled, the remote command is canceled. RunWithInput will run command on the the remote host, writing the process stdout and stderr to
the given writers, and injecting the process stdin with the stdin reader.
Warning stdin (not stdout/stderr) are bufferized, which means reading only one byte in stdin will
send a winrm http packet to the remote host. If stdin is a pipe, it might be better for
performance reasons to buffer it.
If stdin is nil, this is equivalent to c.Run()
Deprecated: use RunWithContextWithInput() RunWithString will run command on the the remote host, returning the process stdout and stderr
as strings, and using the input stdin string as the process input
Deprecated: use RunWithContextWithString()
func NewClient(endpoint *Endpoint, user, password string) (*Client, error)
func NewClientWithParameters(endpoint *Endpoint, user, password string, params *Parameters) (*Client, error)
func github.com/limanmys/render-engine/internal/bridge.InitWinRm(username, password, host, port string, secure bool) (*Client, error)
func ClientAuthRequest.Post(client *Client, request *soap.SoapMessage) (string, error)
func (*ClientKerberos).Post(clt *Client, request *soap.SoapMessage) (string, error)
func ClientNTLM.Post(client *Client, request *soap.SoapMessage) (string, error)
func Transporter.Post(*Client, *soap.SoapMessage) (string, error)
Command represents a given command running on a Shell. This structure allows to get access
to the various stdout, stderr and stdin pipes.Stderr*commandReaderStdin*commandWriterStdout*commandReader Close will terminate the running command ExitCode returns command exit code when it is finished. Before that the result is always 0. Wait function will block the current goroutine until the remote command terminates.
*Command : io.Closer
func (*Shell).Execute(command string, arguments ...string) (*Command, error)
func (*Shell).ExecuteWithContext(ctx context.Context, command string, arguments ...string) (*Command, error)
Endpoint struct holds configurations
for the server endpoint pointer pem certs, and key // cert auth to intdetify the server cert // cert for client auth connections set the flag true for https connections host name or ip address set the flag true for skipping ssl verifications // public key for client auth connections port to determine if it's http or https default
winrm ports (http:5985, https:5986).Versions
of winrm can be customized to listen on other ports if set, used to verify the hostname on the returned certificate duration timeout for the underling tcp conn(http/https base protocol)
if the time exceeds the connection is cloded/timeouts
func NewEndpoint(host string, port int, https bool, insecure bool, Cacert, cert, key []byte, timeout time.Duration) *Endpoint
func NewClient(endpoint *Endpoint, user, password string) (*Client, error)
func NewClientWithParameters(endpoint *Endpoint, user, password string, params *Parameters) (*Client, error)
func (*ClientAuthRequest).Transport(endpoint *Endpoint) error
func (*ClientKerberos).Transport(endpoint *Endpoint) error
func (*ClientNTLM).Transport(endpoint *Endpoint) error
func Transporter.Transport(*Endpoint) error
Shell is the local view of a WinRM Shell of a given Client Close will terminate this shell. No commands can be issued once the shell is closed. Execute command on the given Shell, returning either an error or a Command
Deprecated: user ExecuteWithContext ExecuteWithContext command on the given Shell, returning either an error or a Command
*Shell : io.Closer
func (*Client).CreateShell() (*Shell, error)
func (*Client).NewShell(id string) *Shell
NewClient will create a new remote client on url, connecting with user and password
This function doesn't connect (connection happens only when CreateShell is called)
NewClientWithParameters will create a new remote client on url, connecting with user and password
This function doesn't connect (connection happens only when CreateShell is called)
NewClientWithProxyFunc NewClientWithProxyFunc
NewDeleteShellRequest ...
NewEndpoint returns new pointer to struct Endpoint, with a default 60s response header timeout
NewExecuteCommandRequest exec command on specific shellID
NewGetOutputRequest NewGetOutputRequest
NewOpenShellRequest makes a new soap request
NewParameters return new struct of type Parameters
this struct makes the configuration for the request, size message, etc.
Powershell wraps a PowerShell script
and prepares it for execution by the winrm client
Package-Level Variables (only one)
DefaultParameters return constant config
of type Parameters
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.