config

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = loadConfig()

Functions

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 WriteStateFile

func WriteStateFile(s *StateFile) error

Types

type Spec

type Spec struct {
	NoColor                   bool
	LogLevel                  string `envconfig:"INFRACOST_LOG_LEVEL"  required:"false"`
	DefaultPricingAPIEndpoint string `envconfig:"DEFAULT_INFRACOST_PRICING_API_ENDPOINT" default:"https://pricing.api.infracost.io"`
	PricingAPIEndpoint        string `envconfig:"INFRACOST_PRICING_API_ENDPOINT" required:"true" default:"https://pricing.api.infracost.io"`
	DashboardAPIEndpoint      string `envconfig:"INFRACOST_DASHBOARD_API_ENDPOINT" required:"true" default:"https://dashboard.api.infracost.io"`
	APIKey                    string `envconfig:"INFRACOST_API_KEY"`
}

Spec contains mapping of environment variable names to config values

func (*Spec) IsLogging

func (c *Spec) IsLogging() bool

func (*Spec) SetLogLevel

func (c *Spec) SetLogLevel(l string) error

type StateFile

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

func ReadStateFile

func ReadStateFile() (*StateFile, error)

Jump to

Keyboard shortcuts

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