returnfmt.Errorf("Failed to login to Cloud Foundry: %w",errors.New("Parameters missing. Please provide the Cloud Foundry Endpoint, Org, Space, Username and Password"))
log.Entry().WithField("cfAPI:",options.CfAPIEndpoint).WithField("cfOrg",options.CfOrg).WithField("space",options.CfSpace).Info("Logging into Cloud Foundry..")
err=c.RunExecutable("cf",cfLoginScript...)
}
iferr!=nil{
returnfmt.Errorf("Failed to login to Cloud Foundry: %w",err)
}
log.Entry().Info("Logged in successfully to Cloud Foundry..")
returnnil
}
//Logout logs User out of Cloud Foundry
//Logout can be perforned via 'cf logout' command regardless if user is logged in or not
funcLogout()error{
varcfLogoutScript="logout"
log.Entry().Info("Logging out of Cloud Foundry")
err:=c.RunExecutable("cf",cfLogoutScript)
iferr!=nil{
returnfmt.Errorf("Failed to Logout of Cloud Foundry: %w",err)