github.com/cloudfoundry-incubator/stembuild@v0.0.0-20211223202937-5b61d62226c6/remotemanager/winrm_clientfactory.go (about) 1 package remotemanager 2 3 import ( 4 "github.com/masterzen/winrm" 5 "time" 6 ) 7 8 type WinRMClientFactory struct { 9 host string 10 username string 11 password string 12 } 13 14 func NewWinRmClientFactory(host, username, password string) *WinRMClientFactory { 15 return &WinRMClientFactory{host: host, username: username, password: password} 16 } 17 18 func (f *WinRMClientFactory) Build(timeout time.Duration) (WinRMClient, error) { 19 endpoint := winrm.NewEndpoint(f.host, WinRmPort, false, true, nil, nil, nil, timeout) 20 client, err := winrm.NewClient(endpoint, f.username, f.password) 21 return client, err 22 }