Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasDefaultConfigFile ¶ added in v0.6.0
func HasDefaultConfigFile() bool
HasDefaultConfigFile returns true if the default configuration file exists.
Types ¶
type Config ¶
type Config struct { ActiveDeployment string `toml:"active_deployment" envconfig:"deployment"` Deployments map[string]Deployment `toml:"deployments"` Insecure bool `toml:"-" envconfig:"insecure"` URLOverride string `toml:"-" envconfig:"url"` TokenOverride string `toml:"-" envconfig:"token"` OrganizationIDOverride string `toml:"-" envconfig:"org_id"` ConfigFilePath string `toml:"-"` // contains filtered or unexported fields }
Config is the global Axiom CLI configuration.
func Load ¶
Load the configuration. It behaves like LoadFromReader() but opens a file for reading the TOML configuration.
func LoadDefault ¶
LoadDefault tries to load the default configuration. It behaves like Load() but doesn't fail if the configuration file doesn't exist.
func LoadFromReader ¶
LoadFromReader loads configuration from an io.Reader. Configuration values loaded from the environment overwrite the ones from the TOML configuration. On error, the default configuration or the configuration processed till the error occurred is returned.
func (*Config) DeploymentAliases ¶
DeploymentAliases returns a sorted slice of deployment aliases.
func (*Config) GetActiveDeployment ¶
func (c *Config) GetActiveDeployment() (Deployment, bool)
GetActiveDeployment returns the configured deployment with overrides applied, if given.
func (*Config) IsEmpty ¶ added in v0.6.1
IsEmpty returns true if the configuration does not contain any non-zero values for its user configurable fields.
type Deployment ¶
type Deployment struct { URL string `toml:"url"` Token string `toml:"token"` OrganizationID string `toml:"org_id"` }
Deployment is the configuration for an Axiom instance.