sharedaction

package
v6.26.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2017 License: Apache-2.0 Imports: 5 Imported by: 482

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 NewActor

func NewActor() Actor

NewActor returns an Actor with default settings

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

type EnvironmentVariable struct {
	Name         string
	Description  string
	DefaultValue string
}

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 NoTargetedOrganizationError

type NoTargetedOrganizationError struct {
	BinaryName string
}

NoTargetedOrganizationError represents the scenario when an org is not targeted.

func (NoTargetedOrganizationError) Error

type NoTargetedSpaceError

type NoTargetedSpaceError struct {
	BinaryName string
}

NoTargetedSpaceError represents the scenario when a space is not targeted.

func (NoTargetedSpaceError) Error

func (e NoTargetedSpaceError) Error() string

type NotLoggedInError

type NotLoggedInError struct {
	BinaryName string
}

NotLoggedInError represents the scenario when the user is not logged in.

func (NotLoggedInError) Error

func (e NotLoggedInError) Error() string

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL