setup

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	// TODO: Only works for single org.
	// Add mutli ORG capabilities for comma separated list or missing for "All"
	Organization          string   `required:"" short:"o" env:"TF_ORGANIZATION" help:"Name of the Organization to scrape from."`
	APIToken              string   `short:"t" env:"TF_API_TOKEN" help:"User token for autheticating with the API."`
	APITokenFile          *os.File `placeholder:"/path/to/file" help:"File containing user token for autheticating with the API."`
	APIAddress            string   `placeholder:"https://app.terraform.io/" help:"Terraform API address to scrape metrics from."`
	APIInsecureSkipVerify bool     `help:"Accept any certificate presented by the API."`
	ListenAddress         string   `default:"0.0.0.0:9100" help:"Address to listen on for web interface and telemetry."`
	LogLevel              string   `default:"info" enum:"debug,info,warn,error" help:"Only log messages with the given severity or above. One of: [${enum}]"`
	LogFormat             string   `default:"logfmt" enum:"logfmt,json" help:"Output format of log messages. One of: [${enum}]"`
}

type Config

type Config struct {
	CLI
	Client tfe.Client
	Logger log.Logger
}

func NewConfig

func NewConfig() *Config

NewConfig returns a new Config object that was initialized according to the CLI params.

Jump to

Keyboard shortcuts

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