command

package
v6.50.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: Apache-2.0 Imports: 17 Imported by: 371

Documentation

Overview

Package command should not be imported by external consumers. It was not designed for external use.

Index

Constants

View Source
const ExperimentalWarning = "This command is in EXPERIMENTAL stage and may change without notice"

Variables

This section is empty.

Functions

func CheckVersionOutdated

func CheckVersionOutdated(current string, minimum string) (bool, error)

func DisplayNotLoggedInText

func DisplayNotLoggedInText(binaryName string, ui UI)

func MinimumCCAPIVersionCheck

func MinimumCCAPIVersionCheck(current string, minimum string, customCommand ...string) error

func MinimumUAAAPIVersionCheck

func MinimumUAAAPIVersionCheck(current string, minimum string, customCommand ...string) error

func NewLogCacheClient

func NewLogCacheClient(logCacheEndpoint string, config Config, ui UI) *logcache.Client

NewLogCacheClient returns back a configured Log Cache Client.

func WarnIfAPIVersionBelowSupportedMinimum

func WarnIfAPIVersionBelowSupportedMinimum(apiVersion string, ui UI) error

func WarnIfCLIVersionBelowAPIDefinedMinimum

func WarnIfCLIVersionBelowAPIDefinedMinimum(config Config, apiVersion string, ui UI) error

Types

type APIVersionTooHighError

type APIVersionTooHighError struct{}

func (APIVersionTooHighError) Error

func (a APIVersionTooHighError) Error() string

type Config

type Config interface {
	AccessToken() string
	AddPlugin(configv3.Plugin)
	AddPluginRepository(name string, url string)
	APIVersion() string
	BinaryName() string
	BinaryVersion() string
	CFPassword() string
	CFUsername() string
	ColorEnabled() configv3.ColorSetting
	CurrentUser() (configv3.User, error)
	CurrentUserName() (string, error)
	DialTimeout() time.Duration
	DockerPassword() string
	Experimental() bool
	GetPlugin(pluginName string) (configv3.Plugin, bool)
	GetPluginCaseInsensitive(pluginName string) (configv3.Plugin, bool)
	HasTargetedOrganization() bool
	HasTargetedSpace() bool
	IsTTY() bool
	Locale() string
	MinCLIVersion() string
	NOAARequestRetryCount() int
	OverallPollingTimeout() time.Duration
	PluginHome() string
	PluginRepositories() []configv3.PluginRepository
	Plugins() []configv3.Plugin
	PollingInterval() time.Duration
	RefreshToken() string
	RemovePlugin(string)
	RequestRetryCount() int
	RoutingEndpoint() string
	SetAccessToken(token string)
	SetMinCLIVersion(version string)
	SetOrganizationInformation(guid string, name string)
	SetRefreshToken(token string)
	SetSpaceInformation(guid string, name string, allowSSH bool)
	V7SetSpaceInformation(guid string, name string)
	SetTargetInformation(api string, apiVersion string, auth string, minCLIVersion string, doppler string, routing string, skipSSLValidation bool)
	SetTokenInformation(accessToken string, refreshToken string, sshOAuthClient string)
	SetUAAClientCredentials(client string, clientSecret string)
	SetUAAEndpoint(uaaEndpoint string)
	SetUAAGrantType(uaaGrantType string)
	SkipSSLValidation() bool
	SSHOAuthClient() string
	StagingTimeout() time.Duration
	StartupTimeout() time.Duration
	// TODO: Rename to APITarget()
	Target() string
	TargetedOrganization() configv3.Organization
	TargetedOrganizationName() string
	TargetedSpace() configv3.Space
	TerminalWidth() int
	UAADisableKeepAlives() bool
	UAAGrantType() string
	UAAOAuthClient() string
	UAAOAuthClientSecret() string
	UnsetOrganizationAndSpaceInformation()
	UnsetSpaceInformation()
	UnsetUserInformation()
	Verbose() (bool, []string)
	WritePluginConfig() error
	WriteConfig() error
}

Config a way of getting basic CF configuration

type DebugPrinter

type DebugPrinter struct {
	// contains filtered or unexported fields
}

func (DebugPrinter) Print

func (p DebugPrinter) Print(title, dump string)

type ExtendedCommander

type ExtendedCommander interface {
	flags.Commander
	Setup(Config, UI) error
}

ExtendedCommander extends the go-flags Command interface by forcing a Setup function on all commands. This setup function should setup all command dependencies.

type RequestLoggerOutput

type RequestLoggerOutput interface {
	Start() error
	Stop() error
	DisplayType(name string, requestDate time.Time) error
	DisplayDump(dump string) error
}

type SharedActor

type SharedActor interface {
	IsLoggedIn() bool
	IsSpaceTargeted() bool
	IsOrgTargeted() bool

	CheckTarget(targetedOrganizationRequired bool, targetedSpaceRequired bool) error
	RequireCurrentUser() (string, error)
	RequireTargetedOrg() (string, error)
}

type UI

type UI interface {
	DeferText(template string, data ...map[string]interface{})
	DisplayBoolPrompt(defaultResponse bool, template string, templateValues ...map[string]interface{}) (bool, error)
	DisplayChangesForPush(changeSet []ui.Change) error
	DisplayDeprecationWarning()
	DisplayError(err error)
	DisplayFileDeprecationWarning()
	DisplayHeader(text string)
	DisplayInstancesTableForApp(table [][]string)
	DisplayKeyValueTable(prefix string, table [][]string, padding int)
	DisplayKeyValueTableForApp(table [][]string)
	DisplayLogMessage(message ui.LogMessage, displayHeader bool)
	DisplayNewline()
	DisplayNonWrappingTable(prefix string, table [][]string, padding int)
	DisplayOK()
	DisplayOptionalTextPrompt(defaultValue string, template string, templateValues ...map[string]interface{}) (string, error)
	DisplayPasswordPrompt(template string, templateValues ...map[string]interface{}) (string, error)
	DisplayTableWithHeader(prefix string, table [][]string, padding int)
	DisplayText(template string, data ...map[string]interface{})
	DisplayTextMenu(choices []string, promptTemplate string, templateValues ...map[string]interface{}) (string, error)
	DisplayTextPrompt(template string, templateValues ...map[string]interface{}) (string, error)
	DisplayTextWithBold(text string, keys ...map[string]interface{})
	DisplayTextWithFlavor(text string, keys ...map[string]interface{})
	DisplayWarning(formattedString string, keys ...map[string]interface{})
	DisplayWarnings(warnings []string)
	GetErr() io.Writer
	GetIn() io.Reader
	GetOut() io.Writer
	RequestLoggerFileWriter(filePaths []string) *ui.RequestLoggerFileWriter
	RequestLoggerTerminalDisplay() *ui.RequestLoggerTerminalDisplay
	TranslateText(template string, data ...map[string]interface{}) string
	UserFriendlyDate(input time.Time) string
	Writer() io.Writer
}

UI is the interface to STDOUT, STDERR, and STDIN.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.
Package common should not be imported by external consumers.
Package common should not be imported by external consumers.
commonfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
Package flag should not be imported by external consumers.
Package flag should not be imported by external consumers.
Package plugin should not be imported by external consumers.
Package plugin should not be imported by external consumers.
pluginfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
shared
Package shared should not be imported by external consumers.
Package shared should not be imported by external consumers.
Package translatableerror contains all the command layer translatable errors.
Package translatableerror contains all the command layer translatable errors.
translatableerrorfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
v6
Package v6 should not be imported by external consumers.
Package v6 should not be imported by external consumers.
shared
Package shared should not be imported by external consumers.
Package shared should not be imported by external consumers.
shared/sharedfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
v6fakes
Code generated by counterfeiter.
Code generated by counterfeiter.
v7
Package v7 should not be imported by external consumers.
Package v7 should not be imported by external consumers.
shared
Package shared should not be imported by external consumers.
Package shared should not be imported by external consumers.
v7fakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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