package winrmimport ()// Endpoint struct holds configurations// for the server endpointtypeEndpointstruct {// host name or ip address Host string// 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 Port int// set the flag true for https connections HTTPS bool// set the flag true for skipping ssl verifications Insecure bool// if set, used to verify the hostname on the returned certificate TLSServerName string// pointer pem certs, and key CACert []byte// cert auth to intdetify the server cert Key []byte// public key for client auth connections Cert []byte// cert for client auth connections// duration timeout for the underling tcp conn(http/https base protocol) // if the time exceeds the connection is cloded/timeouts Timeout time.Duration}func ( *Endpoint) () string {varstringif .HTTPS { = "https" } else { = "http" }returnfmt.Sprintf("%s://%s:%d/wsman", , .Host, .Port)}// NewEndpoint returns new pointer to struct Endpoint, with a default 60s response header timeoutfunc ( string, int, bool, bool, , , []byte, time.Duration) *Endpoint { := &Endpoint{Host: ,Port: ,HTTPS: ,Insecure: ,CACert: ,Key: ,Cert: , }// if the timeout was setif != 0 { .Timeout = } else {// assign default 60sec timeout .Timeout = 60 * time.Second }return}
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.