config

package
v3.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AtmosDefaultConstraintEnvName = atmosPrefix + defaultConstraint
	AtmosDefaultVersionEnvName    = atmosPrefix + defaultVersion

	AtmosRemotePassEnvName = atmosPrefix + remotePassEnvName
	AtmosRemoteURLEnvName  = atmosPrefix + remoteURLEnvName
	AtmosRemoteUserEnvName = atmosPrefix + remoteUserEnvName
	AtmosVersionEnvName    = atmosPrefix + version

	TfDefaultConstraintEnvName = tfenvTerraformPrefix + defaultConstraint
	TfDefaultVersionEnvName    = tfenvTerraformPrefix + defaultVersion

	TfRemotePassEnvName = tfenvPrefix + remotePassEnvName
	TfRemoteURLEnvName  = tfenvPrefix + remoteURLEnvName
	TfRemoteUserEnvName = tfenvPrefix + remoteUserEnvName

	TfVersionEnvName = tfenvTerraformPrefix + version

	TgDefaultConstraintEnvName = tgPrefix + defaultConstraint
	TgDefaultVersionEnvName    = tgPrefix + defaultVersion

	TgRemotePassEnvName = tgPrefix + remotePassEnvName
	TgRemoteURLEnvName  = tgPrefix + remoteURLEnvName
	TgRemoteUserEnvName = tgPrefix + remoteUserEnvName
	TgVersionEnvName    = tgPrefix + version

	TofuDefaultConstraintEnvName = tofuenvTofuPrefix + defaultConstraint
	TofuDefaultVersionEnvName    = tofuenvTofuPrefix + defaultVersion

	TofuRemotePassEnvName = tofuenvPrefix + remotePassEnvName
	TofuRemoteURLEnvName  = tofuenvPrefix + remoteURLEnvName
	TofuRemoteUserEnvName = tofuenvPrefix + remoteUserEnvName

	TofuURLTemplateEnvName = tofuenvPrefix + "URL_TEMPLATE"
	TofuVersionEnvName     = tofuenvTofuPrefix + version
)
View Source
const (
	InstallModeDirect = "direct"
	ListModeHTML      = "html"
	ModeAPI           = "api"

	DefaultTofuGithubURL = defaultGithubURL + "opentofu/opentofu" + slashReleases
)

Variables

View Source
var (
	ErrInstallMode = errors.New("unknown install mode")
	ErrListMode    = errors.New("unknown list mode")
)

Functions

func GetBasicAuthOption added in v3.1.0

func GetBasicAuthOption(userEnvName string, passEnvName string) []download.RequestOption

func MapGetDefault

func MapGetDefault(m map[string]string, key string, defaultValue string) string

Types

type Config

type Config struct {
	Arch           string
	Atmos          RemoteConfig
	Displayer      loghelper.Displayer
	DisplayVerbose bool
	ForceQuiet     bool
	ForceRemote    bool
	GithubActions  bool
	GithubToken    string

	RemoteConfPath string
	RootPath       string
	SkipInstall    bool
	SkipSignature  bool
	Tf             RemoteConfig
	TfKeyPath      string
	Tg             RemoteConfig
	Tofu           RemoteConfig
	TofuKeyPath    string
	UserPath       string
	WorkPath       string
	// contains filtered or unexported fields
}

func DefaultConfig added in v3.2.0

func DefaultConfig() (Config, error)

func InitConfigFromEnv

func InitConfigFromEnv() (Config, error)

func (*Config) InitDisplayer

func (conf *Config) InitDisplayer(proxyCall bool)

func (*Config) InitInstall

func (conf *Config) InitInstall(forceInstall bool, forceNoInstall bool)

func (*Config) InitRemoteConf

func (conf *Config) InitRemoteConf() error

type RemoteConfig

type RemoteConfig struct {
	Data map[string]string // values from conf file

	RemoteURL    string // value from flag
	RemoteURLEnv string // value from env
	// contains filtered or unexported fields
}

func (RemoteConfig) GetInstallMode

func (r RemoteConfig) GetInstallMode() string

func (RemoteConfig) GetListMode

func (r RemoteConfig) GetListMode() string

func (RemoteConfig) GetListURL

func (r RemoteConfig) GetListURL() string

func (RemoteConfig) GetRemoteURL

func (r RemoteConfig) GetRemoteURL() string

func (RemoteConfig) GetRewriteRule

func (r RemoteConfig) GetRewriteRule() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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