Documentation ¶
Index ¶
- Constants
- func ConfigPath() (string, error)
- func DefaultConfigDirectory() (string, error)
- func HelpTemplate() string
- type Config
- func (c *Config) ContextListCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func (c *Config) GetApiURL() string
- func (c *Config) GetContexts() (*Contexts, error)
- func (c *Config) GetProject() string
- func (c *Config) GetToken() string
- func (c *Config) MustDefaultContext() Context
- func (c *Config) NewRequestContext() (context.Context, context.CancelFunc)
- func (c *Config) WriteContexts(ctxs *Contexts) error
- type Context
- type Contexts
Constants ¶
View Source
const ( // BinaryName is the name of the cli in all help texts BinaryName = "metal" // ConfigDir is the directory in either the homedir or in /etc where the cli searches for a file config.yaml // also used as prefix for environment based configuration, e.g. METAL_STACK_CLOUD_ will be the variable prefix. ConfigDir = "metal-stack-cloud" )
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶
func DefaultConfigDirectory ¶
func HelpTemplate ¶
func HelpTemplate() string
Types ¶
type Config ¶
type Config struct { Fs afero.Fs In io.Reader Out io.Writer PromptOut io.Writer Client client.Client ListPrinter printers.Printer DescribePrinter printers.Printer Completion *completion.Completion Context Context }
func (*Config) ContextListCompletion ¶
func (*Config) GetContexts ¶
func (*Config) GetProject ¶
func (*Config) MustDefaultContext ¶
func (*Config) NewRequestContext ¶
func (c *Config) NewRequestContext() (context.Context, context.CancelFunc)
func (*Config) WriteContexts ¶
type Context ¶
type Context struct { Name string `json:"name"` ApiURL *string `json:"api-url,omitempty"` Token string `json:"api-token"` DefaultProject string `json:"default-project"` Timeout *time.Duration `json:"timeout,omitempty"` }
Context configure
Click to show internal directories.
Click to hide internal directories.