Documentation ¶
Index ¶
- Variables
- func InitiateUserContext(userContext UserContext, timeout time.Duration) (originalCfHomeDir, currentCfHomeDir string)
- func RestoreUserContext(_ UserContext, timeout time.Duration, ...)
- func TargetSpace(userContext UserContext, timeout time.Duration)
- type GenericResource
- type QueryResponse
- type UserContext
Constants ¶
This section is empty.
Variables ¶
View Source
var ApiRequest = func(method, endpoint string, response interface{}, timeout time.Duration, data ...string) { request := Cf( "curl", endpoint, "-X", method, "-d", strings.Join(data, ""), ) runner.NewCmdRunner(request, timeout).Run() if response != nil { err := json.Unmarshal(request.Out.Contents(), response) Expect(err).ToNot(HaveOccurred()) } }
View Source
var AsUser = func(userContext UserContext, timeout time.Duration, actions func()) { originalCfHomeDir, currentCfHomeDir := InitiateUserContext(userContext, timeout) defer func() { RestoreUserContext(userContext, timeout, originalCfHomeDir, currentCfHomeDir) }() TargetSpace(userContext, timeout) actions() }
Functions ¶
func InitiateUserContext ¶
func InitiateUserContext(userContext UserContext, timeout time.Duration) (originalCfHomeDir, currentCfHomeDir string)
func RestoreUserContext ¶
func RestoreUserContext(_ UserContext, timeout time.Duration, originalCfHomeDir, currentCfHomeDir string)
func TargetSpace ¶
func TargetSpace(userContext UserContext, timeout time.Duration)
Types ¶
type GenericResource ¶
type GenericResource struct { Metadata struct { Guid string `json:"guid"` } `json:"metadata"` }
type QueryResponse ¶
type QueryResponse struct {
Resources []GenericResource `struct:"resources"`
}
type UserContext ¶
type UserContext struct { ApiUrl string Username string Password string Org string Space string SkipSSLValidation bool }
func NewUserContext ¶
func NewUserContext(apiUrl, username, password, org, space string, skipSSLValidation bool) UserContext
Click to show internal directories.
Click to hide internal directories.