cmd

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(version string) int

Execute runs the root command and returns the exit code

func GenDocs

func GenDocs() error

GenDocs generates the CLI documentation

func NewAPITokenCmd added in v0.6.2

func NewAPITokenCmd(ec *ExecutionContext) *cobra.Command

New creates a new api-token command

func NewCreateClusterCmd

func NewCreateClusterCmd(ec *ExecutionContext) *cobra.Command

New creates a new "create cluster" command

func NewCreateCmd

func NewCreateCmd(ec *ExecutionContext) *cobra.Command

New creates a new create command

func NewDeleteClusterCmd

func NewDeleteClusterCmd(ec *ExecutionContext) *cobra.Command

New creates a new "delete cluster" command

func NewDeleteCmd

func NewDeleteCmd(ec *ExecutionContext) *cobra.Command

New creates a new delete command

func NewFiltersHelpCmd added in v0.5.2

func NewFiltersHelpCmd(ec *ExecutionContext) *cobra.Command

New creates a new filters command

func NewGetClusterCmd

func NewGetClusterCmd(ec *ExecutionContext) *cobra.Command

New creates a new "get cluster" command

func NewGetClusterNodeCmd added in v0.6.2

func NewGetClusterNodeCmd(ec *ExecutionContext) *cobra.Command

New creates a new "get cluster-node" command

func NewGetClusterNodesCmd added in v0.6.2

func NewGetClusterNodesCmd(ec *ExecutionContext) *cobra.Command

New creates a new "get cluster-nodes" command

func NewGetClustersCmd

func NewGetClustersCmd(ec *ExecutionContext) *cobra.Command

New creates a new "get clusters" command

func NewGetCmd

func NewGetCmd(ec *ExecutionContext) *cobra.Command

New creates a new get command

func NewGetPartitionsCmd

func NewGetPartitionsCmd(ec *ExecutionContext) *cobra.Command

New creates a new "get partitions" command

func NewGetRegionsCmd

func NewGetRegionsCmd(ec *ExecutionContext) *cobra.Command

New creates a new "get regions" command

func NewGetResilienceZonesCmd

func NewGetResilienceZonesCmd(ec *ExecutionContext) *cobra.Command

New creates a new "get resilience-zones" command

func NewLoginCmd

func NewLoginCmd(ec *ExecutionContext) *cobra.Command

New creates a new login command

func NewLogoutCmd

func NewLogoutCmd(ec *ExecutionContext) *cobra.Command

New creates a new logout command

func NewRootCmd

func NewRootCmd(ec *ExecutionContext) *cobra.Command

func NewUpdateClusterCmd added in v0.5.0

func NewUpdateClusterCmd(ec *ExecutionContext) *cobra.Command

New creates a new "update cluster" command

func NewUpdateCmd added in v0.5.0

func NewUpdateCmd(ec *ExecutionContext) *cobra.Command

New creates a new update command

Types

type ExecutionContext

type ExecutionContext struct {
	Stdout, Stderr io.Writer

	// Command is the current command
	Command *cobra.Command

	// Version is the CLI version
	Version string

	// Logger is the global logger object to print logs.
	Logger logger.Logger

	// Spinner is the global spinner object used to show progress across the cli
	Spinner *ui.Spinner

	// LogLevel is the log level used for the logger
	LogLevel string

	// APIServer is the inventory api server endpoint
	APIServer string

	// Interactive can be used to force interactive/non-interactive use
	Interactive string

	// IsTerminal indicates whether the current session is a terminal or not
	IsTerminal bool

	// OutputFormat is the format used for outputting data
	OutputFormat string

	// NoHeaders is used to control whether headers are printed
	NoHeaders bool

	// OIDC is the OIDC settings
	OIDC OIDCConfig

	// OIDC is the OIDC provider settings
	OIDCProvider *oidc.Provider

	// Authenticator is the Authenticator
	Authenticator authentication.Authenticator

	// TokenCache is the token cache
	TokenCache tokencache.Cache

	// APIClient is an inventory server api client
	APIClient apiclient.ClientWithResponsesInterface
}

ExecutionContext holds configuration that can be used (and modified) across the application

func NewExecutionContext

func NewExecutionContext(in ExecutionContextInput) *ExecutionContext

NewExecutionContext creates a new ExecutionContext

func (*ExecutionContext) SetLogLevel

func (ec *ExecutionContext) SetLogLevel()

SetLogLevel sets the ec.Logger log level

func (*ExecutionContext) SetupDefaultAPIClient

func (ec *ExecutionContext) SetupDefaultAPIClient(token string) (err error)

SetupDefaultAPIClient sets up ec.APIClient from flags if it's not already set

func (*ExecutionContext) SetupDefaultAuthenticator

func (ec *ExecutionContext) SetupDefaultAuthenticator()

SetupDefaultAuthenticator sets up ec.Authenticator from flags if it's not already set It should be called from rootCmd.PersistentPreRunE

func (*ExecutionContext) SetupDefaultOIDCProvider

func (ec *ExecutionContext) SetupDefaultOIDCProvider()

SetupDefaultOIDCProvider sets up ec.OIDCProvider from flags if it's not already set It should be called from rootCmd.PersistentPreRunE

func (*ExecutionContext) SetupDefaultTokenCache

func (ec *ExecutionContext) SetupDefaultTokenCache() (err error)

SetupDefaultTokenCache sets up ec.TokenCache from flags if it's not already set It should be called from rootCmd.PersistentPreRunE

func (*ExecutionContext) Spin

func (ec *ExecutionContext) Spin(t string)

Spin starts the spinnner and sets its text

type ExecutionContextInput

type ExecutionContextInput struct {
	Stdout  io.Writer
	Stderr  io.Writer
	Version string
}

type InvalidArgumentError

type InvalidArgumentError struct {
	Flag     string
	Val      string
	OneOf    []string
	SeeOther string
	Context  string
}

func (*InvalidArgumentError) Error

func (e *InvalidArgumentError) Error() string

type OIDCConfig

type OIDCConfig struct {
	IssuerURL                   string
	ClientID                    string
	GrantType                   string
	RedirectURLHostname         string
	RedirectURIAuthCodeKeyboard string
	AuthBindAddr                string
	TokenCacheDir               string
}

OIDCConfig holds flag values for OIDC settings

Jump to

Keyboard shortcuts

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