Documentation ¶
Index ¶
- func ConfigFilePath() string
- func GetUserAgent() string
- func IsDev() bool
- func IsTest() bool
- func IsTruthy(s string) bool
- func LogSortingFunc(keys []string)
- func RootDir() string
- func StateFilePath() string
- func WriteConfigFile(c ConfigSpec) error
- func WriteStateFile(s StateFile) error
- type ConfigSpec
- type StateFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFilePath ¶ added in v0.6.5
func ConfigFilePath() string
func GetUserAgent ¶
func GetUserAgent() string
func LogSortingFunc ¶
func LogSortingFunc(keys []string)
func StateFilePath ¶ added in v0.6.5
func StateFilePath() string
func WriteConfigFile ¶ added in v0.6.5
func WriteConfigFile(c ConfigSpec) error
func WriteStateFile ¶
Types ¶
type ConfigSpec ¶ added in v0.6.5
type ConfigSpec struct { NoColor bool `yaml:"no_color,omitempty"` LogLevel string `yaml:"log_level,omitempty" envconfig:"INFRACOST_LOG_LEVEL"` APIKey string `yaml:"api_key,omitempty" envconfig:"INFRACOST_API_KEY"` PricingAPIEndpoint string `yaml:"pricing_api_endpoint,omitempty" envconfig:"INFRACOST_PRICING_API_ENDPOINT"` DefaultPricingAPIEndpoint string `yaml:"default_pricing_api_endpoint,omitempty" envconfig:"INFRACOST_DEFAULT_PRICING_API_ENDPOINT"` DashboardAPIEndpoint string `yaml:"dashboard_api_endpoint,omitempty" envconfig:"INFRACOST_DASHBOARD_API_ENDPOINT"` TerraformCloudHost string `yaml:"terraform_cloud_host,omitempty" envconfig:"TERRAFORM_CLOUD_HOST"` TerraformCloudToken string `yaml:"terraform_cloud_token,omitempty" envconfig:"TERRAFORM_CLOUD_TOKEN"` }
Spec contains mapping of environment variable names to config values
var Config *ConfigSpec
func ReadConfigFileIfExists ¶ added in v0.6.5
func ReadConfigFileIfExists() (ConfigSpec, error)
func (*ConfigSpec) IsLogging ¶ added in v0.6.5
func (c *ConfigSpec) IsLogging() bool
func (*ConfigSpec) SetLogLevel ¶ added in v0.6.5
func (c *ConfigSpec) SetLogLevel(l string) error
Click to show internal directories.
Click to hide internal directories.