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 = "NEW_RELIC_CLI" )
View Source
const ( // DefaultLogLevel is the default log level DefaultLogLevel = "INFO" // DefaultLogFile is the default log file DefaultLogFile = "newrelic-cli.log" )
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 )
View Source
var TernaryValues = struct { // Allow the option Allow Ternary // Disallow the option Disallow Ternary // Unknown is the unknown state Unknown Ternary }{ Allow: "ALLOW", Disallow: "DISALLOW", Unknown: "NOT_ASKED", }
TernaryValues provides the set of Ternary values
Functions ¶
func InitFileLogger ¶ added in v0.22.0
func InitFileLogger()
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 Ternary `mapstructure:"sendUsageData"` // SendUsageData enables sending usage statistics to New Relic PreReleaseFeatures Ternary `mapstructure:"preReleaseFeatures"` // PreReleaseFeatures enables display on features within the CLI that are announced but not generally available to customers // 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 LogrusFileHook ¶ added in v0.8.11
type LogrusFileHook struct {
// contains filtered or unexported fields
}
func NewLogrusFileHook ¶ added in v0.8.11
func (*LogrusFileHook) Fire ¶ added in v0.8.11
func (hook *LogrusFileHook) Fire(entry *log.Entry) error
func (*LogrusFileHook) Levels ¶ added in v0.8.11
func (hook *LogrusFileHook) Levels() []log.Level
type Ternary ¶ added in v0.8.11
type Ternary string
Ternary is like a bool, but includes the unknown state
func (Ternary) Bool ¶ added in v0.8.11
Bool returns true if the ternary is set and contains the true value
Click to show internal directories.
Click to hide internal directories.