Documentation ¶
Index ¶
- func AddAuthHeaders(apiKey string, req *http.Request)
- func AddNoAuthHeaders(req *http.Request)
- func CredentialsFilePath() string
- func IsFalsy(s string) bool
- func IsTruthy(s string) bool
- func RootDir() string
- func TraceID() string
- type Config
- type ConfigFileSpec
- type Credentials
- type CredentialsProfileSpec
- type Environment
- type Project
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAuthHeaders ¶ added in v0.7.11
func AddNoAuthHeaders ¶ added in v0.7.11
func CredentialsFilePath ¶ added in v0.7.17
func CredentialsFilePath() string
Types ¶
type Config ¶
type Config struct { Environment *Environment State *State Credentials Credentials Version string `yaml:"version,omitempty" ignored:"true"` LogLevel string `yaml:"log_level,omitempty" envconfig:"INFRACOST_LOG_LEVEL"` NoColor bool `yaml:"no_color,omitempty" envconfig:"INFRACOST_NO_COLOR"` SkipUpdateCheck bool `yaml:"skip_update_check,omitempty" envconfig:"INFRACOST_SKIP_UPDATE_CHECK"` APIKey string `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"` Projects []*Project `yaml:"projects" ignored:"true"` Format string `yaml:"format,omitempty" ignored:"true"` ShowSkipped bool `yaml:"show_skipped,omitempty" ignored:"true"` }
func DefaultConfig ¶ added in v0.7.17
func DefaultConfig() *Config
func (*Config) ConfigureLogger ¶ added in v0.7.17
func (*Config) LoadFromConfigFile ¶ added in v0.8.0
func (*Config) LoadFromEnv ¶ added in v0.7.17
type ConfigFileSpec ¶ added in v0.8.0
type ConfigFileSpec struct { Version string `yaml:"version"` Projects []*Project `yaml:"projects" ignored:"true"` }
func LoadConfigFile ¶ added in v0.8.0
func LoadConfigFile(path string) (ConfigFileSpec, error)
type Credentials ¶ added in v0.7.17
type Credentials map[string]CredentialsProfileSpec
func (Credentials) Save ¶ added in v0.7.17
func (c Credentials) Save() error
type CredentialsProfileSpec ¶ added in v0.7.17
type CredentialsProfileSpec struct {
APIKey string `yaml:"api_key"`
}
type Environment ¶ added in v0.7.11
type Environment struct { Version string `json:"version"` FullVersion string `json:"fullVersion"` IsTest bool `json:"isTest"` IsDev bool `json:"isDev"` InstallID string `json:"installId"` IsDefaultPricingAPIEndpoint bool `json:"isDefaultPricingAPIEndpoint"` OS string `json:"os"` CIPlatform string `json:"ciPlatform,omitempty"` CIScript string `json:"ciScript,omitempty"` Command string `json:"command"` Flags []string `json:"flags"` OutputFormat string `json:"outputFormat"` ProjectType string `json:"projectType"` TerraformBinary string `json:"terraformBinary"` TerraformFullVersion string `json:"terraformFullVersion"` TerraformVersion string `json:"terraformVersion"` TerraformRemoteExecutionModeEnabled bool `json:"terraformRemoteExecutionModeEnabled"` TerraformInfracostProviderEnabled bool `json:"terraformInfracostProviderEnabled"` IsAWSChina bool `json:"isAwsChina"` HasConfigFile bool `json:"hasConfigFile"` HasUsageFile bool `json:"hasUsageFile"` }
func NewEnvironment ¶ added in v0.7.17
func NewEnvironment() *Environment
func (*Environment) SetProjectEnvironment ¶ added in v0.8.0
func (e *Environment) SetProjectEnvironment(projectType string, projectCfg *Project)
type Project ¶ added in v0.8.0
type Project struct { Path string `yaml:"path,omitempty" ignored:"true"` TerraformPlanFlags string `yaml:"terraform_plan_flags,omitempty" ignored:"true"` TerraformBinary string `yaml:"terraform_binary,omitempty" envconfig:"INFRACOST_TERRAFORM_BINARY"` TerraformWorkspace string `yaml:"terraform_workspace,omitempty" envconfig:"INFRACOST_TERRAFORM_WORKSPACE"` TerraformCloudHost string `yaml:"terraform_cloud_host,omitempty" envconfig:"INFRACOST_TERRAFORM_CLOUD_HOST"` TerraformCloudToken string `yaml:"terraform_cloud_token,omitempty" envconfig:"INFRACOST_TERRAFORM_CLOUD_TOKEN"` UsageFile string `yaml:"usage_file,omitempty" ignored:"true"` TerraformUseState bool `yaml:"terraform_use_state,omitempty" ignored:"true"` }
Click to show internal directories.
Click to hide internal directories.