GetSpace gets the current space from the CLI connection
()
| 30 | |
| 31 | // GetSpace gets the current space from the CLI connection |
| 32 | func (c *CloudFoundryContext) GetSpace() (plugin_models.Space, error) { |
| 33 | space, err := c.cliConnection.GetCurrentSpace() |
| 34 | if err != nil { |
| 35 | return plugin_models.Space{}, fmt.Errorf("Could not get current space: %s", err) |
| 36 | } |
| 37 | |
| 38 | if space.Name == "" || space.Guid == "" { |
| 39 | return plugin_models.Space{}, fmt.Errorf("No space targeted, use %q to target a space", terminal.CommandColor("cf target -s SPACE")) |
| 40 | } |
| 41 | return space, nil |
| 42 | } |
| 43 | |
| 44 | // GetUsername gets the username from the CLI connection |
| 45 | func (c *CloudFoundryContext) GetUsername() (string, error) { |
no outgoing calls
no test coverage detected