package winrm

Import Path
	github.com/masterzen/winrm (on go.dev)

Dependency Relation
	imports 27 packages, and imported by one package


Package-Level Type Names (total 11)
/* sort by: | */
Client struct Parameters Parameters Parameters.Dial func(network, addr string) (net.Conn, error) Parameters.EnvelopeSize int Parameters.Locale string Parameters.Timeout string Parameters.TransportDecorator func() 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)
ClientAuthRequest ClientAuthRequest Post Post Transport Transport *ClientAuthRequest : Transporter func NewClientAuthRequestWithDial(dial func(network, addr string) (net.Conn, error)) *ClientAuthRequest
Hostname string KrbCCache string KrbConf string Password string Port int Proto string Realm string SPN string Username string (*ClientKerberos) Post(clt *Client, request *soap.SoapMessage) (string, error) (*ClientKerberos) Transport(endpoint *Endpoint) error *ClientKerberos : Transporter func NewClientKerberos(settings *Settings) *ClientKerberos
ClientNTLM provides a transport via NTLMv2 Post make post to the winrm soap service (forwarded to clientRequest implementation) Transport creates the wrapped NTLM transport *ClientNTLM : Transporter func NewClientNTLMWithDial(dial func(network, addr string) (net.Conn, error)) *ClientNTLM func NewClientNTLMWithProxyFunc(proxyfunc func(req *http.Request) (*url.URL, error)) *ClientNTLM
Command represents a given command running on a Shell. This structure allows to get access to the various stdout, stderr and stdin pipes. Stderr *commandReader Stdin *commandWriter Stdout *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
Body string Inner error (*ExecuteCommandError) Error() string (*ExecuteCommandError) Is(err error) bool (*ExecuteCommandError) Unwrap() error *ExecuteCommandError : error
Parameters struct defines metadata information and http transport config Dial func(network, addr string) (net.Conn, error) EnvelopeSize int Locale string Timeout string TransportDecorator func() Transporter func NewParameters(timeout, locale string, envelopeSize int) *Parameters func NewClientWithParameters(endpoint *Endpoint, user, password string, params *Parameters) (*Client, error) func NewDeleteShellRequest(uri, shellID string, params *Parameters) *soap.SoapMessage func NewExecuteCommandRequest(uri, shellID, command string, arguments []string, params *Parameters) *soap.SoapMessage func NewGetOutputRequest(uri, shellID, commandID, streams string, params *Parameters) *soap.SoapMessage func NewOpenShellRequest(uri string, params *Parameters) *soap.SoapMessage func NewSendInputRequest(uri, shellID, commandID string, input []byte, eof bool, params *Parameters) *soap.SoapMessage func NewSignalRequest(uri string, shellID string, commandID string, params *Parameters) *soap.SoapMessage var DefaultParameters *Parameters
Settings holds all the information necessary to configure the provider KrbCCache string KrbConfig string KrbRealm string KrbSpn string WinRMHost string WinRMInsecure bool WinRMPassCredentials bool WinRMPassword string WinRMPort int WinRMProto string WinRMUseNTLM bool WinRMUsername string func NewClientKerberos(settings *Settings) *ClientKerberos
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
Transporter does different transporters and init a Post request based on them init request baset on the transport configurations ( Transporter) Transport(*Endpoint) error *ClientAuthRequest *ClientKerberos *ClientNTLM
Package-Level Functions (total 21)
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)
NewClientAuthRequestWithDial NewClientAuthRequestWithDial
NewClientNTLMWithDial NewClientNTLMWithDial
NewClientNTLMWithProxyFunc NewClientNTLMWithProxyFunc
NewClientWithDial NewClientWithDial
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.
NewSendInputRequest NewSendInputRequest
NewSignalRequest NewSignalRequest
ParseExecuteCommandResponse ParseExecuteCommandResponse
ParseOpenShellResponse ParseOpenShellResponse
ParseSlurpOutputErrResponse ParseSlurpOutputErrResponse
ParseSlurpOutputResponse ParseSlurpOutputResponse
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