config

package
v0.0.0-...-01bf647 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSConfig

type AWSConfig struct {
	DynamoDBTable string         `long:"dynamodb-table" env:"AWS_DYNAMODB_TABLE" yaml:"dynamodb-table" description:"AWS DynamoDB table for locks."`
	S3            S3BucketConfig `group:"S3 Options" yaml:"s3"`
	Endpoint      string         `long:"aws-endpoint" env:"AWS_ENDPOINT" yaml:"endpoint" description:"AWS endpoint."`
	APPRoleArn    string         `long:"aws-role-arn" env:"APP_ROLE_ARN" yaml:"app-role-arn" description:"Role ARN to Assume."`
}

AWSConfig stores the DynamoDB table and S3 Bucket configuration

type Config

type Config struct {
	Version bool `short:"V" long:"version" description:"Display version."`

	ConfigFilePath string `short:"c" long:"config-file" env:"CONFIG_FILE" description:"Config File path"`

	Log LogConfig `group:"Logging Options" yaml:"log"`

	DB DBConfig `group:"Database Options" yaml:"database"`

	AWS AWSConfig `group:"AWS Options" yaml:"aws"`

	TFE TFEConfig `group:"Terraform Enterprise Options" yaml:"tfe"`

	GCP GCPConfig `group:"Google Cloud Platform Options" yaml:"gcp"`

	Web WebConfig `group:"Web" yaml:"web"`
}

Config stores the handler's configuration and UI interface parameters

func LoadConfig

func LoadConfig(version string) *Config

LoadConfig loads the config from flags & environment

func (*Config) LoadConfigFromYaml

func (c *Config) LoadConfigFromYaml() *Config

LoadConfigFromYaml loads the config from config file

func (Config) SetupLogging

func (c Config) SetupLogging() (err error)

SetupLogging sets up logging for Terraboard

type DBConfig

type DBConfig struct {
	Host         string `long:"db-host" env:"DB_HOST" yaml:"host" description:"Database host." default:"db"`
	Port         uint16 `long:"db-port" env:"DB_PORT" yaml:"port" description:"Database port." default:"5432"`
	User         string `long:"db-user" env:"DB_USER" yaml:"user" description:"Database user." default:"gorm"`
	Password     string `long:"db-password" env:"DB_PASSWORD" yaml:"password" description:"Database password."`
	Name         string `long:"db-name" env:"DB_NAME" yaml:"name" description:"Database name." default:"gorm"`
	SSLMode      string `long:"db-sslmode" env:"DB_SSLMODE" yaml:"sslmode" description:"Database SSL mode." default:"require"`
	NoSync       bool   `long:"no-sync" yaml:"no-sync" description:"Do not sync database."`
	SyncInterval uint16 `long:"sync-interval" yaml:"sync-interval" description:"DB sync interval (in minutes)" default:"1"`
}

DBConfig stores the database configuration

type GCPConfig

type GCPConfig struct {
	GCSBuckets []string `long:"gcs-bucket" yaml:"gcs-bucket" description:"Google Cloud bucket to search"`
	GCPSAKey   string   `` /* 156-byte string literal not displayed */
}

GCPConfig stores the Google Cloud configutation

type LogConfig

type LogConfig struct {
	Level  string `` /* 163-byte string literal not displayed */
	Format string `long:"log-format" yaml:"format" env:"TERRABOARD_LOG_FORMAT" description:"Set log format ('plain', 'json')." default:"plain"`
}

LogConfig stores the log configuration

type S3BucketConfig

type S3BucketConfig struct {
	Bucket        string `long:"s3-bucket" env:"AWS_BUCKET" yaml:"bucket" description:"AWS S3 bucket."`
	KeyPrefix     string `long:"key-prefix" env:"AWS_KEY_PREFIX" yaml:"key-prefix" description:"AWS Key Prefix."`
	FileExtension string `` /* 132-byte string literal not displayed */
}

S3BucketConfig stores the S3 bucket configuration

type TFEConfig

type TFEConfig struct {
	Address      string `long:"tfe-address" env:"TFE_ADDRESS" yaml:"tfe-address" description:"Terraform Enterprise address for states access"`
	Token        string `long:"tfe-token" env:"TFE_TOKEN" yaml:"tfe-token" description:"Terraform Enterprise Token for states access"`
	Organization string `` /* 136-byte string literal not displayed */
}

TFEConfig stores the Terraform Enterprise configuration

type WebConfig

type WebConfig struct {
	Port      uint16 `short:"p" long:"port" env:"TERRABOARD_PORT" yaml:"port" description:"Port to listen on." default:"8080"`
	BaseURL   string `long:"base-url" env:"TERRABOARD_BASE_URL" yaml:"base-url" description:"Base URL." default:"/"`
	LogoutURL string `long:"logout-url" env:"TERRABOARD_LOGOUT_URL" yaml:"logout-url" description:"Logout URL."`
}

WebConfig stores the UI interface parameters

Jump to

Keyboard shortcuts

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