config

package
v0.7.16 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAuthHeaders added in v0.7.11

func AddAuthHeaders(req *http.Request)

func AddNoAuthHeaders added in v0.7.11

func AddNoAuthHeaders(req *http.Request)

func ConfigFilePath added in v0.6.5

func ConfigFilePath() string

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 TraceID added in v0.7.11

func TraceID() 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 EnvironmentSpec added in v0.7.11

type EnvironmentSpec struct {
	Version                             string   `json:"version"`
	FullVersion                         string   `json:"fullVersion"`
	Flags                               []string `json:"flags"`
	OutputFormat                        string   `json:"outputFormat"`
	IsTest                              bool     `json:"isTest"`
	IsDev                               bool     `json:"isDev"`
	OS                                  string   `json:"os"`
	CIPlatform                          string   `json:"ciPlatform,omitempty"`
	CIScript                            string   `json:"ciScript,omitempty"`
	TerraformBinary                     string   `json:"terraformBinary"`
	TerraformFullVersion                string   `json:"terraformFullVersion"`
	TerraformVersion                    string   `json:"terraformVersion"`
	TerraformRemoteExecutionModeEnabled bool     `json:"terraformRemoteExecutionModeEnabled"`
	TerraformInfracostProviderEnabled   bool     `json:"terraformInfracostProviderEnabled"`
	HasUsageFile                        bool     `json:"hasUsageFile"`
	IsAWSChina                          bool     `json:"isAwsChina"`
}
var Environment *EnvironmentSpec

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