config

package
v0.7.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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 IsDev

func IsDev() bool

func IsTest

func IsTest() bool

func IsTruthy

func IsTruthy(s string) bool

func LogSortingFunc

func LogSortingFunc(keys []string)

func RootDir

func RootDir() 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

func WriteStateFile(s StateFile) error

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

type StateFile

type StateFile struct {
	LatestReleaseVersion   string `json:"latestReleaseVersion"`
	LatestReleaseCheckedAt string `json:"latestReleaseCheckedAt"`
}

func ReadStateFileIfNotExists added in v0.6.5

func ReadStateFileIfNotExists() (StateFile, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL