Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultConfigName is the default name of the global configuration file DefaultConfigName = "config" // DefaultConfigType to read, though any file type supported by viper is allowed DefaultConfigType = "json" // DefaultEnvPrefix is used when reading environment variables DefaultEnvPrefix = "newrelic" // DefaultLogLevel is the default log level DefaultLogLevel = "INFO" // DefaultSendUsageData is the default value for sendUsageData DefaultSendUsageData = "NOT_ASKED" )
Variables ¶
View Source
var Command = &cobra.Command{
Use: "config",
Short: "Manage the configuration of the New Relic CLI",
}
Command is the base command for managing profiles
View Source
var ( // DefaultConfigDirectory is the default location for the CLI config files DefaultConfigDirectory string )
Functions ¶
func WithConfig ¶
func WithConfig(f func(c *Config))
WithConfig loads and returns the CLI configuration.
func WithConfigFrom ¶
WithConfigFrom loads and returns the CLI configuration from a specified location.
Types ¶
type Config ¶
type Config struct { LogLevel string `mapstructure:"logLevel"` // LogLevel for verbose output PluginDir string `mapstructure:"pluginDir"` // PluginDir is the directory where plugins will be installed SendUsageData string `mapstructure:"sendUsageData"` // SendUsageData enables sending usage statistics to New Relic // contains filtered or unexported fields }
Config contains the main CLI configuration
func LoadConfig ¶
LoadConfig loads the configuration from disk, substituting defaults if the file does not exist.
type TableRenderer ¶
type TableRenderer struct{}
TableRenderer represents the presentation layer for human readable command output.
func NewTableRenderer ¶
func NewTableRenderer() *TableRenderer
NewTableRenderer returns a new instance of TableRenderer.
func (*TableRenderer) Delete ¶
func (tr *TableRenderer) Delete(key string)
Delete renders output for the delete command.
func (*TableRenderer) Get ¶
func (tr *TableRenderer) Get(c *Config, key string)
Get renders output for the get command.
func (*TableRenderer) List ¶
func (tr *TableRenderer) List(c *Config)
List renders output for the list command.
func (*TableRenderer) Set ¶
func (tr *TableRenderer) Set(key string, value string)
Set renders output for the set command.
Click to show internal directories.
Click to hide internal directories.