Documentation ¶
Overview ¶
Package sharedaction handles all operations that do not require a cloud controller
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct{}
Actor handles all shared actions
func (Actor) CheckTarget ¶
func (Actor) CheckTarget(config Config, targetedOrganizationRequired bool, targetedSpaceRequired bool) error
CheckTarget confirms that the user is logged in. Optionally it will also check if an organization and space are targeted.
func (Actor) CommandInfoByName ¶
func (Actor) CommandInfoByName(commandList interface{}, commandName string) (CommandInfo, error)
CommandInfoByName returns the help information for a particular commandName in the commandList.
func (Actor) CommandInfos ¶
func (Actor) CommandInfos(commandList interface{}) map[string]CommandInfo
CommandInfos returns a slice of CommandInfo that only fills in the Name and Description for all the commands in commandList
type CommandFlag ¶
type CommandFlag struct { // Short is the short form of the flag Short string // Long is the long form of the flag Long string // Description is the description of the flag Description string // Default is the flag's default value Default string }
CommandFlag contains the help details of a command's flag
type CommandInfo ¶
type CommandInfo struct { // Name is the command name Name string // Description is the command description Description string // Alias is the command alias Alias string // Usage is the command usage string, may contain examples and flavor text Usage string // RelatedCommands is a list of commands related to the command RelatedCommands []string // Flags contains the list of flags for this command Flags []CommandFlag // Environment is a list of environment variables specific for this command Environment []EnvironmentVariable }
CommandInfo contains the help details of a command
type Config ¶
type Config interface { AccessToken() string BinaryName() string HasTargetedOrganization() bool HasTargetedSpace() bool RefreshToken() string }
Config a way of getting basic CF configuration
type EnvironmentVariable ¶
Environment contains env vars specific for this command
type ErrorInvalidCommand ¶
type ErrorInvalidCommand struct {
CommandName string
}
ErrorInvalidCommand represents an error that happens when help is called with an invalid command.
func (ErrorInvalidCommand) Error ¶
func (err ErrorInvalidCommand) Error() string
type NoOrganizationTargetedError ¶
type NoOrganizationTargetedError struct {
BinaryName string
}
NoOrganizationTargetedError represents the scenario when an org is not targeted.
func (NoOrganizationTargetedError) Error ¶
func (NoOrganizationTargetedError) Error() string
type NoSpaceTargetedError ¶
type NoSpaceTargetedError struct {
BinaryName string
}
NoSpaceTargetedError represents the scenario when a space is not targeted.
func (NoSpaceTargetedError) Error ¶
func (NoSpaceTargetedError) Error() string
type NotLoggedInError ¶
type NotLoggedInError struct {
BinaryName string
}
NotLoggedInError represents the scenario when the user is not logged in.
func (NotLoggedInError) Error ¶
func (NotLoggedInError) Error() string