Documentation
¶
Index ¶
- Constants
- func AddApplicationFlag(cmd *cobra.Command)
- func AddComponentFlag(cmd *cobra.Command)
- func AddProjectFlag(cmd *cobra.Command)
- func Client(command *cobra.Command) *occlient.Client
- func ClientWithConnectionCheck(command *cobra.Command, skipConnectionCheck bool) *occlient.Client
- func FlagValueIfSet(cmd *cobra.Command, flagName string) string
- type Context
Constants ¶
const ( // SkipConnectionCheckFlagName is the name of the global flag used to skip connection check in the client SkipConnectionCheckFlagName = "skip-connection-check" // ProjectFlagName is the name of the flag allowing a user to specify which project to operate on ProjectFlagName = "project" // ApplicationFlagName is the name of the flag allowing a user to specify which application to operate on ApplicationFlagName = "app" // ComponentFlagName is the name of the flag allowing a user to specify which component to operate on ComponentFlagName = "component" )
Variables ¶
This section is empty.
Functions ¶
func AddApplicationFlag ¶ added in v0.0.17
func AddComponentFlag ¶ added in v0.0.17
func AddProjectFlag ¶ added in v0.0.17
func ClientWithConnectionCheck ¶
ClientWithConnectionCheck returns an oc client configured for this command's options but forcing the connection check status to the value of the provided bool, skipping it if true, checking the connection otherwise
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context holds contextual information useful to commands such as correctly configured client, target project and application (based on specified flag values) and provides for a way to retrieve a given component given this context
func NewContext ¶
NewContext creates a new Context struct populated with the current state based on flags specified for the provided command
func NewContextCreatingAppIfNeeded ¶
NewContextCreatingAppIfNeeded creates a new Context struct populated with the current state based on flags specified for the provided command, creating the application if none already exists
func NewFakeContext ¶
func (*Context) Component ¶
Component retrieves the optionally specified component or the current one if it is set. If no component is set, exit with an error
func (*Context) ComponentAllowingEmpty ¶
ComponentAllowingEmpty retrieves the optionally specified component or the current one if it is set, allowing empty components (instead of exiting with an error) if so specified