views

package
v1.12.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MPL-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const JSON_UI_VERSION = "1.2"

This version describes the schema of JSON UI messages. This version must be updated after making any changes to this view, the jsonHook, or any of the command/views/json package.

Variables

View Source
var ErrorInputDisabled = fmt.Errorf("in this view cannot ask user input")

Functions

func NewUIOptionalHook

func NewUIOptionalHook(view *View) ghoten.Hook

func NewViewUI

func NewViewUI(args arguments.ViewOptions, view *View, oldUi cli.Ui) cli.Ui

func SaveErroredTestStateFile

func SaveErroredTestStateFile(state *states.State, run *moduletest.Run, file *moduletest.File, view Test)

SaveErroredTestStateFile is a helper function to invoked in DestroySummary to store the state to errored_test.tfstate and handle associated diagnostics and errors with this operation

Types

type Apply

type Apply interface {
	ResourceCount(stateOutPath string)
	Outputs(outputValues map[string]*states.OutputValue)

	Operation() Operation
	Hooks() []ghoten.Hook

	Diagnostics(diags tfdiags.Diagnostics)
	HelpPrompt()
}

The Apply view is used for the apply command.

func NewApply

func NewApply(args arguments.ViewOptions, destroy bool, view *View) Apply

NewApply returns an initialized Apply implementation for the given ViewType.

type ApplyHuman

type ApplyHuman struct {
	// contains filtered or unexported fields
}

The ApplyHuman implementation renders human-readable text logs, suitable for a scrolling terminal.

func (*ApplyHuman) Diagnostics

func (v *ApplyHuman) Diagnostics(diags tfdiags.Diagnostics)

func (*ApplyHuman) HelpPrompt

func (v *ApplyHuman) HelpPrompt()

func (*ApplyHuman) Hooks

func (v *ApplyHuman) Hooks() []ghoten.Hook

func (*ApplyHuman) Operation

func (v *ApplyHuman) Operation() Operation

func (*ApplyHuman) Outputs

func (v *ApplyHuman) Outputs(outputValues map[string]*states.OutputValue)

func (*ApplyHuman) ResourceCount

func (v *ApplyHuman) ResourceCount(stateOutPath string)

type ApplyJSON

type ApplyJSON struct {
	// contains filtered or unexported fields
}

The ApplyJSON implementation renders streaming JSON logs, suitable for integrating with other software.

func (*ApplyJSON) Diagnostics

func (v *ApplyJSON) Diagnostics(diags tfdiags.Diagnostics)

func (*ApplyJSON) HelpPrompt

func (v *ApplyJSON) HelpPrompt()

func (*ApplyJSON) Hooks

func (v *ApplyJSON) Hooks() []ghoten.Hook

func (*ApplyJSON) Operation

func (v *ApplyJSON) Operation() Operation

func (*ApplyJSON) Outputs

func (v *ApplyJSON) Outputs(outputValues map[string]*states.OutputValue)

func (*ApplyJSON) ResourceCount

func (v *ApplyJSON) ResourceCount(stateOutPath string)

type ApplyMulti

type ApplyMulti []Apply

func (ApplyMulti) Diagnostics

func (m ApplyMulti) Diagnostics(diags tfdiags.Diagnostics)

func (ApplyMulti) HelpPrompt

func (m ApplyMulti) HelpPrompt()

func (ApplyMulti) Hooks

func (m ApplyMulti) Hooks() []ghoten.Hook

func (ApplyMulti) Operation

func (m ApplyMulti) Operation() Operation

func (ApplyMulti) Outputs

func (m ApplyMulti) Outputs(outputValues map[string]*states.OutputValue)

func (ApplyMulti) ResourceCount

func (m ApplyMulti) ResourceCount(stateOutPath string)

type Get

type Get interface {
	Diagnostics(diags tfdiags.Diagnostics)
	Hooks(showLocalDir bool) initwd.ModuleInstallHooks
}

func NewGet

func NewGet(args arguments.ViewOptions, view *View) Get

NewGet returns an initialized Get implementation for the given ViewType.

type GetHuman

type GetHuman struct {
	// contains filtered or unexported fields
}

func (*GetHuman) Diagnostics

func (v *GetHuman) Diagnostics(diags tfdiags.Diagnostics)

func (*GetHuman) Hooks

func (v *GetHuman) Hooks(showLocalPath bool) initwd.ModuleInstallHooks

type GetJSON

type GetJSON struct {
	// contains filtered or unexported fields
}

func (*GetJSON) Diagnostics

func (v *GetJSON) Diagnostics(diags tfdiags.Diagnostics)

func (*GetJSON) Hooks

func (v *GetJSON) Hooks(showLocalPath bool) initwd.ModuleInstallHooks

type GetMulti

type GetMulti []Get

func (GetMulti) Diagnostics

func (m GetMulti) Diagnostics(diags tfdiags.Diagnostics)

func (GetMulti) Hooks

func (m GetMulti) Hooks(showLocalPath bool) initwd.ModuleInstallHooks

type Init

type Init interface {
	CopyFromModule(src string)
	InitialisedFromEmptyDir()

	Diagnostics(diags tfdiags.Diagnostics)
	HelpPrompt()

	ConfigError()
	OutputNewline()
	InitSuccess(cloud bool)
	InitSuccessCLI(cloud bool)

	InitializingModules(upgrade bool)

	InitializingCloudBackend()
	InitializingBackend()
	BackendTypeAlias(backendType, canonType string)

	InitializingProviderPlugins()
	ProviderAlreadyInstalled(provider string, version string, inCache bool)
	BuiltInProviderAvailable(provider string)
	ReusingLockFileVersion(provider string)
	FindingProviderVersions(provider string, constraints string)
	FindingLatestProviderVersion(provider string)
	UsingProviderFromCache(provider string, version string)
	InstallingProvider(provider string, version string, toCache bool)
	ProviderInstalled(provider string, version string, authResult string, keyID string)
	ProviderInstalledSkippedSignature(provider string, version string)
	WaitingForCacheLock(cacheDir string)
	ProvidersSignedInfo()
	ProviderUpgradeLockfileConflict()
	ProviderInstallationInterrupted()
	LockFileCreated()
	LockFileChanged()
	Hooks(showLocalDir bool) initwd.ModuleInstallHooks
}

func NewInit

func NewInit(args arguments.ViewOptions, view *View) Init

NewInit returns an initialized Init implementation for the given ViewType.

type InitHuman

type InitHuman struct {
	// contains filtered or unexported fields
}

func (*InitHuman) BackendTypeAlias

func (v *InitHuman) BackendTypeAlias(backendType, canonType string)

func (*InitHuman) BuiltInProviderAvailable

func (v *InitHuman) BuiltInProviderAvailable(provider string)

func (*InitHuman) ConfigError

func (v *InitHuman) ConfigError()

func (*InitHuman) CopyFromModule

func (v *InitHuman) CopyFromModule(src string)

func (*InitHuman) Diagnostics

func (v *InitHuman) Diagnostics(diags tfdiags.Diagnostics)

func (*InitHuman) FindingLatestProviderVersion

func (v *InitHuman) FindingLatestProviderVersion(provider string)

func (*InitHuman) FindingProviderVersions

func (v *InitHuman) FindingProviderVersions(provider string, constraints string)

func (*InitHuman) HelpPrompt

func (v *InitHuman) HelpPrompt()

func (*InitHuman) Hooks

func (v *InitHuman) Hooks(showLocalPath bool) initwd.ModuleInstallHooks

func (*InitHuman) InitSuccess

func (v *InitHuman) InitSuccess(cloud bool)

func (*InitHuman) InitSuccessCLI

func (v *InitHuman) InitSuccessCLI(cloud bool)

func (*InitHuman) InitialisedFromEmptyDir

func (v *InitHuman) InitialisedFromEmptyDir()

func (*InitHuman) InitializingBackend

func (v *InitHuman) InitializingBackend()

func (*InitHuman) InitializingCloudBackend

func (v *InitHuman) InitializingCloudBackend()

func (*InitHuman) InitializingModules

func (v *InitHuman) InitializingModules(upgrade bool)

func (*InitHuman) InitializingProviderPlugins

func (v *InitHuman) InitializingProviderPlugins()

func (*InitHuman) InstallingProvider

func (v *InitHuman) InstallingProvider(provider string, version string, toCache bool)

func (*InitHuman) LockFileChanged

func (v *InitHuman) LockFileChanged()

func (*InitHuman) LockFileCreated

func (v *InitHuman) LockFileCreated()

func (*InitHuman) OutputNewline

func (v *InitHuman) OutputNewline()

func (*InitHuman) ProviderAlreadyInstalled

func (v *InitHuman) ProviderAlreadyInstalled(provider string, version string, inCache bool)

func (*InitHuman) ProviderInstallationInterrupted

func (v *InitHuman) ProviderInstallationInterrupted()

func (*InitHuman) ProviderInstalled

func (v *InitHuman) ProviderInstalled(provider string, version string, authResult string, keyID string)

func (*InitHuman) ProviderInstalledSkippedSignature

func (v *InitHuman) ProviderInstalledSkippedSignature(provider string, version string)

func (*InitHuman) ProviderUpgradeLockfileConflict

func (v *InitHuman) ProviderUpgradeLockfileConflict()

func (*InitHuman) ProvidersSignedInfo

func (v *InitHuman) ProvidersSignedInfo()

func (*InitHuman) ReusingLockFileVersion

func (v *InitHuman) ReusingLockFileVersion(provider string)

func (*InitHuman) UsingProviderFromCache

func (v *InitHuman) UsingProviderFromCache(provider string, version string)

func (*InitHuman) WaitingForCacheLock

func (v *InitHuman) WaitingForCacheLock(cacheDir string)

type InitJSON

type InitJSON struct {
	// contains filtered or unexported fields
}

func (*InitJSON) BackendTypeAlias

func (v *InitJSON) BackendTypeAlias(backendType, canonType string)

func (*InitJSON) BuiltInProviderAvailable

func (v *InitJSON) BuiltInProviderAvailable(provider string)

func (*InitJSON) ConfigError

func (v *InitJSON) ConfigError()

func (*InitJSON) CopyFromModule

func (v *InitJSON) CopyFromModule(src string)

func (*InitJSON) Diagnostics

func (v *InitJSON) Diagnostics(diags tfdiags.Diagnostics)

func (*InitJSON) FindingLatestProviderVersion

func (v *InitJSON) FindingLatestProviderVersion(provider string)

func (*InitJSON) FindingProviderVersions

func (v *InitJSON) FindingProviderVersions(provider string, constraints string)

func (*InitJSON) HelpPrompt

func (v *InitJSON) HelpPrompt()

func (*InitJSON) Hooks

func (v *InitJSON) Hooks(showLocalPath bool) initwd.ModuleInstallHooks

func (*InitJSON) InitSuccess

func (v *InitJSON) InitSuccess(cloud bool)

func (*InitJSON) InitSuccessCLI

func (v *InitJSON) InitSuccessCLI(cloud bool)

func (*InitJSON) InitialisedFromEmptyDir

func (v *InitJSON) InitialisedFromEmptyDir()

func (*InitJSON) InitializingBackend

func (v *InitJSON) InitializingBackend()

func (*InitJSON) InitializingCloudBackend

func (v *InitJSON) InitializingCloudBackend()

func (*InitJSON) InitializingModules

func (v *InitJSON) InitializingModules(upgrade bool)

func (*InitJSON) InitializingProviderPlugins

func (v *InitJSON) InitializingProviderPlugins()

func (*InitJSON) InstallingProvider

func (v *InitJSON) InstallingProvider(provider string, version string, toCache bool)

func (*InitJSON) LockFileChanged

func (v *InitJSON) LockFileChanged()

func (*InitJSON) LockFileCreated

func (v *InitJSON) LockFileCreated()

func (*InitJSON) OutputNewline

func (v *InitJSON) OutputNewline()

func (*InitJSON) ProviderAlreadyInstalled

func (v *InitJSON) ProviderAlreadyInstalled(provider string, version string, inCache bool)

func (*InitJSON) ProviderInstallationInterrupted

func (v *InitJSON) ProviderInstallationInterrupted()

func (*InitJSON) ProviderInstalled

func (v *InitJSON) ProviderInstalled(provider string, version string, authResult string, keyID string)

func (*InitJSON) ProviderInstalledSkippedSignature

func (v *InitJSON) ProviderInstalledSkippedSignature(provider string, version string)

func (*InitJSON) ProviderUpgradeLockfileConflict

func (v *InitJSON) ProviderUpgradeLockfileConflict()

func (*InitJSON) ProvidersSignedInfo

func (v *InitJSON) ProvidersSignedInfo()

func (*InitJSON) ReusingLockFileVersion

func (v *InitJSON) ReusingLockFileVersion(provider string)

func (*InitJSON) UsingProviderFromCache

func (v *InitJSON) UsingProviderFromCache(provider string, version string)

func (*InitJSON) WaitingForCacheLock

func (v *InitJSON) WaitingForCacheLock(cacheDir string)

type InitMulti

type InitMulti []Init

func (InitMulti) BackendTypeAlias

func (m InitMulti) BackendTypeAlias(backendType, canonType string)

func (InitMulti) BuiltInProviderAvailable

func (m InitMulti) BuiltInProviderAvailable(provider string)

func (InitMulti) ConfigError

func (m InitMulti) ConfigError()

func (InitMulti) CopyFromModule

func (m InitMulti) CopyFromModule(src string)

func (InitMulti) Diagnostics

func (m InitMulti) Diagnostics(diags tfdiags.Diagnostics)

func (InitMulti) FindingLatestProviderVersion

func (m InitMulti) FindingLatestProviderVersion(provider string)

func (InitMulti) FindingProviderVersions

func (m InitMulti) FindingProviderVersions(provider string, constraints string)

func (InitMulti) HelpPrompt

func (m InitMulti) HelpPrompt()

func (InitMulti) Hooks

func (m InitMulti) Hooks(showLocalPath bool) initwd.ModuleInstallHooks

func (InitMulti) InitSuccess

func (m InitMulti) InitSuccess(cloud bool)

func (InitMulti) InitSuccessCLI

func (m InitMulti) InitSuccessCLI(cloud bool)

func (InitMulti) InitialisedFromEmptyDir

func (m InitMulti) InitialisedFromEmptyDir()

func (InitMulti) InitializingBackend

func (m InitMulti) InitializingBackend()

func (InitMulti) InitializingCloudBackend

func (m InitMulti) InitializingCloudBackend()

func (InitMulti) InitializingModules

func (m InitMulti) InitializingModules(upgrade bool)

func (InitMulti) InitializingProviderPlugins

func (m InitMulti) InitializingProviderPlugins()

func (InitMulti) InstallingProvider

func (m InitMulti) InstallingProvider(provider string, version string, toCache bool)

func (InitMulti) LockFileChanged

func (m InitMulti) LockFileChanged()

func (InitMulti) LockFileCreated

func (m InitMulti) LockFileCreated()

func (InitMulti) OutputNewline

func (m InitMulti) OutputNewline()

func (InitMulti) ProviderAlreadyInstalled

func (m InitMulti) ProviderAlreadyInstalled(provider string, version string, inCache bool)

func (InitMulti) ProviderInstallationInterrupted

func (m InitMulti) ProviderInstallationInterrupted()

func (InitMulti) ProviderInstalled

func (m InitMulti) ProviderInstalled(provider string, version string, authResult string, keyID string)

func (InitMulti) ProviderInstalledSkippedSignature

func (m InitMulti) ProviderInstalledSkippedSignature(provider string, version string)

func (InitMulti) ProviderUpgradeLockfileConflict

func (m InitMulti) ProviderUpgradeLockfileConflict()

func (InitMulti) ProvidersSignedInfo

func (m InitMulti) ProvidersSignedInfo()

func (InitMulti) ReusingLockFileVersion

func (m InitMulti) ReusingLockFileVersion(provider string)

func (InitMulti) UsingProviderFromCache

func (m InitMulti) UsingProviderFromCache(provider string, version string)

func (InitMulti) WaitingForCacheLock

func (m InitMulti) WaitingForCacheLock(cacheDir string)

type JSONView

type JSONView struct {
	// contains filtered or unexported fields
}

func NewJSONView

func NewJSONView(view *View, out *os.File) *JSONView

func (*JSONView) ChangeSummary

func (v *JSONView) ChangeSummary(cs *json.ChangeSummary)

func (*JSONView) Diagnostics

func (v *JSONView) Diagnostics(diags tfdiags.Diagnostics, metadata ...interface{})

func (*JSONView) Error

func (v *JSONView) Error(message string)

Error is designed for supporting command.WrappedUi

func (*JSONView) Hook

func (v *JSONView) Hook(h json.Hook)

func (*JSONView) Info

func (v *JSONView) Info(message string)

Info is designed for supporting command.WrappedUi

func (*JSONView) Log

func (v *JSONView) Log(message string)

func (*JSONView) Output

func (v *JSONView) Output(message string)

Output is designed for supporting command.WrappedUi

func (*JSONView) Outputs

func (v *JSONView) Outputs(outputs jsonentities.Outputs)

func (*JSONView) PlannedChange

func (v *JSONView) PlannedChange(c *jsonentities.ResourceInstanceChange)

func (*JSONView) ResourceDrift

func (v *JSONView) ResourceDrift(c *jsonentities.ResourceInstanceChange)

func (*JSONView) StateDump

func (v *JSONView) StateDump(state string)

func (*JSONView) Version

func (v *JSONView) Version()

func (*JSONView) Warn

func (v *JSONView) Warn(message string)

Warn is designed for supporting command.WrappedUi

type Login

type Login interface {
	Diagnostics(diags tfdiags.Diagnostics)
	HelpPrompt(credentialsFile string)

	UiSeparator()
	MOTDMessage(msg string)
	DefaultTFCLoginSuccess()
	DefaultTFELoginSuccess(dispHostname string)
	TokenObtainedConfirmation(dispHostname string)
	OpeningBrowserForOAuth(dispHostname, authCodeURL string)
	ManualBrowserLaunch(dispHostname, authCodeURL string)
	WaitingForHostSignal()
	PasswordRequestHeader()
	OpeningBrowserForTokens(dispHostname, tokensURL string)
	ManualBrowserLaunchForTokens(dispHostname, tokensURL string)
	GenerateTokenInstruction()
	TokenStorageInFile(localFilename string)
	TokenStorageInHelper(helperType string)
	RetrievedTokenForUser(username string)
	RequestAPITokenMessage(dispHostname, mechanism string)
	BrowserBasedLoginInstruction()
	StorageLocationConsentInHelper(helperType string)
	StorageLocationConsentInFile(localFilename string)
}

func NewLogin

func NewLogin(args arguments.ViewOptions, view *View) Login

NewLogin returns an initialized Login implementation for the given ViewType.

type LoginHuman

type LoginHuman struct {
	// contains filtered or unexported fields
}

func (*LoginHuman) BrowserBasedLoginInstruction

func (v *LoginHuman) BrowserBasedLoginInstruction()

func (*LoginHuman) DefaultTFCLoginSuccess

func (v *LoginHuman) DefaultTFCLoginSuccess()

func (*LoginHuman) DefaultTFELoginSuccess

func (v *LoginHuman) DefaultTFELoginSuccess(dispHostname string)

func (*LoginHuman) Diagnostics

func (v *LoginHuman) Diagnostics(diags tfdiags.Diagnostics)

func (*LoginHuman) GenerateTokenInstruction

func (v *LoginHuman) GenerateTokenInstruction()

func (*LoginHuman) HelpPrompt

func (v *LoginHuman) HelpPrompt(credentialsFile string)

func (*LoginHuman) MOTDMessage

func (v *LoginHuman) MOTDMessage(msg string)

func (*LoginHuman) ManualBrowserLaunch

func (v *LoginHuman) ManualBrowserLaunch(dispHostname, authCodeURL string)

func (*LoginHuman) ManualBrowserLaunchForTokens

func (v *LoginHuman) ManualBrowserLaunchForTokens(dispHostname, tokensURL string)

func (*LoginHuman) OpeningBrowserForOAuth

func (v *LoginHuman) OpeningBrowserForOAuth(dispHostname, authCodeURL string)

func (*LoginHuman) OpeningBrowserForTokens

func (v *LoginHuman) OpeningBrowserForTokens(dispHostname, tokensURL string)

func (*LoginHuman) PasswordRequestHeader

func (v *LoginHuman) PasswordRequestHeader()

func (*LoginHuman) RequestAPITokenMessage

func (v *LoginHuman) RequestAPITokenMessage(dispHostname, mechanism string)

func (*LoginHuman) RetrievedTokenForUser

func (v *LoginHuman) RetrievedTokenForUser(username string)

func (*LoginHuman) StorageLocationConsentInFile

func (v *LoginHuman) StorageLocationConsentInFile(localFilename string)

func (*LoginHuman) StorageLocationConsentInHelper

func (v *LoginHuman) StorageLocationConsentInHelper(helperType string)

func (*LoginHuman) TokenObtainedConfirmation

func (v *LoginHuman) TokenObtainedConfirmation(dispHostname string)

func (*LoginHuman) TokenStorageInFile

func (v *LoginHuman) TokenStorageInFile(localFilename string)

func (*LoginHuman) TokenStorageInHelper

func (v *LoginHuman) TokenStorageInHelper(helperType string)

func (*LoginHuman) UiSeparator

func (v *LoginHuman) UiSeparator()

func (*LoginHuman) WaitingForHostSignal

func (v *LoginHuman) WaitingForHostSignal()

type LoginJSON

type LoginJSON struct {
	// contains filtered or unexported fields
}

func (*LoginJSON) BrowserBasedLoginInstruction

func (v *LoginJSON) BrowserBasedLoginInstruction()

func (*LoginJSON) DefaultTFCLoginSuccess

func (v *LoginJSON) DefaultTFCLoginSuccess()

func (*LoginJSON) DefaultTFELoginSuccess

func (v *LoginJSON) DefaultTFELoginSuccess(dispHostname string)

func (*LoginJSON) Diagnostics

func (v *LoginJSON) Diagnostics(diags tfdiags.Diagnostics)

func (*LoginJSON) GenerateTokenInstruction

func (v *LoginJSON) GenerateTokenInstruction()

func (*LoginJSON) HelpPrompt

func (v *LoginJSON) HelpPrompt(credentialsFile string)

func (*LoginJSON) MOTDMessage

func (v *LoginJSON) MOTDMessage(msg string)

func (*LoginJSON) ManualBrowserLaunch

func (v *LoginJSON) ManualBrowserLaunch(dispHostname, authCodeURL string)

func (*LoginJSON) ManualBrowserLaunchForTokens

func (v *LoginJSON) ManualBrowserLaunchForTokens(dispHostname, tokensURL string)

func (*LoginJSON) OpeningBrowserForOAuth

func (v *LoginJSON) OpeningBrowserForOAuth(dispHostname, authCodeURL string)

func (*LoginJSON) OpeningBrowserForTokens

func (v *LoginJSON) OpeningBrowserForTokens(dispHostname, tokensURL string)

func (*LoginJSON) PasswordRequestHeader

func (v *LoginJSON) PasswordRequestHeader()

func (*LoginJSON) RequestAPITokenMessage

func (v *LoginJSON) RequestAPITokenMessage(dispHostname, mechanism string)

func (*LoginJSON) RetrievedTokenForUser

func (v *LoginJSON) RetrievedTokenForUser(username string)

func (*LoginJSON) StorageLocationConsentInFile

func (v *LoginJSON) StorageLocationConsentInFile(localFilename string)

func (*LoginJSON) StorageLocationConsentInHelper

func (v *LoginJSON) StorageLocationConsentInHelper(helperType string)

func (*LoginJSON) TokenObtainedConfirmation

func (v *LoginJSON) TokenObtainedConfirmation(dispHostname string)

func (*LoginJSON) TokenStorageInFile

func (v *LoginJSON) TokenStorageInFile(localFilename string)

func (*LoginJSON) TokenStorageInHelper

func (v *LoginJSON) TokenStorageInHelper(helperType string)

func (*LoginJSON) UiSeparator

func (v *LoginJSON) UiSeparator()

func (*LoginJSON) WaitingForHostSignal

func (v *LoginJSON) WaitingForHostSignal()

type LoginMulti

type LoginMulti []Login

func (LoginMulti) BrowserBasedLoginInstruction

func (m LoginMulti) BrowserBasedLoginInstruction()

func (LoginMulti) DefaultTFCLoginSuccess

func (m LoginMulti) DefaultTFCLoginSuccess()

func (LoginMulti) DefaultTFELoginSuccess

func (m LoginMulti) DefaultTFELoginSuccess(dispHostname string)

func (LoginMulti) Diagnostics

func (m LoginMulti) Diagnostics(diags tfdiags.Diagnostics)

func (LoginMulti) GenerateTokenInstruction

func (m LoginMulti) GenerateTokenInstruction()

func (LoginMulti) HelpPrompt

func (m LoginMulti) HelpPrompt(credentialsFile string)

func (LoginMulti) MOTDMessage

func (m LoginMulti) MOTDMessage(msg string)

func (LoginMulti) ManualBrowserLaunch

func (m LoginMulti) ManualBrowserLaunch(dispHostname, authCodeURL string)

func (LoginMulti) ManualBrowserLaunchForTokens

func (m LoginMulti) ManualBrowserLaunchForTokens(dispHostname, tokensURL string)

func (LoginMulti) OpeningBrowserForOAuth

func (m LoginMulti) OpeningBrowserForOAuth(dispHostname, authCodeURL string)

func (LoginMulti) OpeningBrowserForTokens

func (m LoginMulti) OpeningBrowserForTokens(dispHostname, tokensURL string)

func (LoginMulti) PasswordRequestHeader

func (m LoginMulti) PasswordRequestHeader()

func (LoginMulti) RequestAPITokenMessage

func (m LoginMulti) RequestAPITokenMessage(dispHostname, mechanism string)

func (LoginMulti) RetrievedTokenForUser

func (m LoginMulti) RetrievedTokenForUser(username string)

func (LoginMulti) StorageLocationConsentInFile

func (m LoginMulti) StorageLocationConsentInFile(localFilename string)

func (LoginMulti) StorageLocationConsentInHelper

func (m LoginMulti) StorageLocationConsentInHelper(helperType string)

func (LoginMulti) TokenObtainedConfirmation

func (m LoginMulti) TokenObtainedConfirmation(dispHostname string)

func (LoginMulti) TokenStorageInFile

func (m LoginMulti) TokenStorageInFile(localFilename string)

func (LoginMulti) TokenStorageInHelper

func (m LoginMulti) TokenStorageInHelper(helperType string)

func (LoginMulti) UiSeparator

func (m LoginMulti) UiSeparator()

func (LoginMulti) WaitingForHostSignal

func (m LoginMulti) WaitingForHostSignal()

type Logout

type Logout interface {
	Diagnostics(diags tfdiags.Diagnostics)

	NoCredentialsStored(dispHostname string)
	RemovingCredentialsFromHelper(dispHostname, helperType string)
	RemovingCredentialsFromFile(dispHostname, localFilename string)
	LogoutSuccess(dispHostname string)
}

func NewLogout

func NewLogout(args arguments.ViewOptions, view *View) Logout

NewLogout returns an initialized Logout implementation for the given ViewType.

type LogoutHuman

type LogoutHuman struct {
	// contains filtered or unexported fields
}

func (*LogoutHuman) Diagnostics

func (v *LogoutHuman) Diagnostics(diags tfdiags.Diagnostics)

func (*LogoutHuman) LogoutSuccess

func (v *LogoutHuman) LogoutSuccess(dispHostname string)

func (*LogoutHuman) NoCredentialsStored

func (v *LogoutHuman) NoCredentialsStored(dispHostname string)

func (*LogoutHuman) RemovingCredentialsFromFile

func (v *LogoutHuman) RemovingCredentialsFromFile(dispHostname, localFilename string)

func (*LogoutHuman) RemovingCredentialsFromHelper

func (v *LogoutHuman) RemovingCredentialsFromHelper(dispHostname, helperType string)

type LogoutJSON

type LogoutJSON struct {
	// contains filtered or unexported fields
}

func (*LogoutJSON) Diagnostics

func (v *LogoutJSON) Diagnostics(diags tfdiags.Diagnostics)

func (*LogoutJSON) LogoutSuccess

func (v *LogoutJSON) LogoutSuccess(dispHostname string)

func (*LogoutJSON) NoCredentialsStored

func (v *LogoutJSON) NoCredentialsStored(dispHostname string)

func (*LogoutJSON) RemovingCredentialsFromFile

func (v *LogoutJSON) RemovingCredentialsFromFile(dispHostname, localFilename string)

func (*LogoutJSON) RemovingCredentialsFromHelper

func (v *LogoutJSON) RemovingCredentialsFromHelper(dispHostname, helperType string)

type LogoutMulti

type LogoutMulti []Logout

func (LogoutMulti) Diagnostics

func (m LogoutMulti) Diagnostics(diags tfdiags.Diagnostics)

func (LogoutMulti) LogoutSuccess

func (m LogoutMulti) LogoutSuccess(dispHostname string)

func (LogoutMulti) NoCredentialsStored

func (m LogoutMulti) NoCredentialsStored(dispHostname string)

func (LogoutMulti) RemovingCredentialsFromFile

func (m LogoutMulti) RemovingCredentialsFromFile(dispHostname, localFilename string)

func (LogoutMulti) RemovingCredentialsFromHelper

func (m LogoutMulti) RemovingCredentialsFromHelper(dispHostname, helperType string)

type Operation

type Operation interface {
	Interrupted()
	FatalInterrupt()
	Stopping()
	Cancelled(planMode plans.Mode)

	EmergencyDumpState(stateFile *statefile.File, enc encryption.StateEncryption) error

	PlannedChange(change *plans.ResourceInstanceChangeSrc)
	Plan(plan *plans.Plan, schemas *ghoten.Schemas)
	PlanNextStep(planPath string, genConfigPath string)

	Diagnostics(diags tfdiags.Diagnostics)
}

func NewOperation

func NewOperation(vt arguments.ViewType, inAutomation bool, view *View) Operation

type OperationHuman

type OperationHuman struct {
	// contains filtered or unexported fields
}

func (*OperationHuman) Cancelled

func (v *OperationHuman) Cancelled(planMode plans.Mode)

func (*OperationHuman) Diagnostics

func (v *OperationHuman) Diagnostics(diags tfdiags.Diagnostics)

func (*OperationHuman) EmergencyDumpState

func (v *OperationHuman) EmergencyDumpState(stateFile *statefile.File, enc encryption.StateEncryption) error

func (*OperationHuman) FatalInterrupt

func (v *OperationHuman) FatalInterrupt()

func (*OperationHuman) Interrupted

func (v *OperationHuman) Interrupted()

func (*OperationHuman) Plan

func (v *OperationHuman) Plan(plan *plans.Plan, schemas *ghoten.Schemas)

func (*OperationHuman) PlanNextStep

func (v *OperationHuman) PlanNextStep(planPath string, genConfigPath string)

PlanNextStep gives the user some next-steps, unless we're running in an automation tool which is presumed to provide its own UI for further actions.

func (*OperationHuman) PlannedChange

func (v *OperationHuman) PlannedChange(change *plans.ResourceInstanceChangeSrc)

func (*OperationHuman) Stopping

func (v *OperationHuman) Stopping()

type OperationJSON

type OperationJSON struct {
	// contains filtered or unexported fields
}

func (*OperationJSON) Cancelled

func (v *OperationJSON) Cancelled(planMode plans.Mode)

func (*OperationJSON) Diagnostics

func (v *OperationJSON) Diagnostics(diags tfdiags.Diagnostics)

func (*OperationJSON) EmergencyDumpState

func (v *OperationJSON) EmergencyDumpState(stateFile *statefile.File, enc encryption.StateEncryption) error

func (*OperationJSON) FatalInterrupt

func (v *OperationJSON) FatalInterrupt()

func (*OperationJSON) Interrupted

func (v *OperationJSON) Interrupted()

func (*OperationJSON) Plan

func (v *OperationJSON) Plan(plan *plans.Plan, schemas *ghoten.Schemas)

Log a change summary and a series of "planned" messages for the changes in the plan.

func (*OperationJSON) PlanNextStep

func (v *OperationJSON) PlanNextStep(planPath string, genConfigPath string)

PlanNextStep does nothing for the JSON view as it is a hook for user-facing output only applicable to human-readable UI.

func (*OperationJSON) PlannedChange

func (v *OperationJSON) PlannedChange(change *plans.ResourceInstanceChangeSrc)

func (*OperationJSON) Stopping

func (v *OperationJSON) Stopping()

type OperationMulti

type OperationMulti []Operation

func (OperationMulti) Cancelled

func (o OperationMulti) Cancelled(planMode plans.Mode)

func (OperationMulti) Diagnostics

func (o OperationMulti) Diagnostics(diags tfdiags.Diagnostics)

func (OperationMulti) EmergencyDumpState

func (o OperationMulti) EmergencyDumpState(stateFile *statefile.File, enc encryption.StateEncryption) error

func (OperationMulti) FatalInterrupt

func (o OperationMulti) FatalInterrupt()

func (OperationMulti) Interrupted

func (o OperationMulti) Interrupted()

func (OperationMulti) Plan

func (o OperationMulti) Plan(plan *plans.Plan, schemas *ghoten.Schemas)

func (OperationMulti) PlanNextStep

func (o OperationMulti) PlanNextStep(planPath string, genConfigPath string)

func (OperationMulti) PlannedChange

func (o OperationMulti) PlannedChange(change *plans.ResourceInstanceChangeSrc)

func (OperationMulti) Stopping

func (o OperationMulti) Stopping()

type Output

type Output interface {
	Output(name string, outputs map[string]*states.OutputValue) tfdiags.Diagnostics
	Diagnostics(diags tfdiags.Diagnostics)
}

The Output view renders either one or all outputs, depending on whether or not the name argument is empty.

func NewOutput

func NewOutput(args arguments.ViewOptions, view *View) Output

NewOutput returns an initialized Output implementation for the given ViewType.

type OutputHuman

type OutputHuman struct {
	// contains filtered or unexported fields
}

The OutputHuman implementation renders outputs in a format equivalent to HCL source. This uses the same formatting logic as in the console REPL.

func (*OutputHuman) Diagnostics

func (v *OutputHuman) Diagnostics(diags tfdiags.Diagnostics)

func (*OutputHuman) Output

func (v *OutputHuman) Output(name string, outputs map[string]*states.OutputValue) tfdiags.Diagnostics

type OutputJSON

type OutputJSON struct {
	// contains filtered or unexported fields
}

The OutputJSON implementation renders outputs as JSON values. When rendering a single output, only the value is displayed. When rendering all outputs, the result is a JSON object with keys matching the output names and object values including type and sensitivity metadata.

func (*OutputJSON) Diagnostics

func (v *OutputJSON) Diagnostics(diags tfdiags.Diagnostics)

func (*OutputJSON) Output

func (v *OutputJSON) Output(name string, outputs map[string]*states.OutputValue) tfdiags.Diagnostics

type OutputMulti

type OutputMulti []Output

func (OutputMulti) Diagnostics

func (m OutputMulti) Diagnostics(diags tfdiags.Diagnostics)

func (OutputMulti) Output

func (m OutputMulti) Output(name string, outputs map[string]*states.OutputValue) tfdiags.Diagnostics

type OutputRaw

type OutputRaw struct {
	// contains filtered or unexported fields
}

The OutputRaw implementation renders single string, number, or boolean output values directly and without quotes or other formatting. This is intended for use in shell scripting or other environments where the exact type of an output value is not important.

func (*OutputRaw) Diagnostics

func (v *OutputRaw) Diagnostics(diags tfdiags.Diagnostics)

func (*OutputRaw) Output

func (v *OutputRaw) Output(name string, outputs map[string]*states.OutputValue) tfdiags.Diagnostics

type Plan

type Plan interface {
	Operation() Operation
	Hooks() []ghoten.Hook

	Diagnostics(diags tfdiags.Diagnostics)
	HelpPrompt()
}

The Plan view is used for the plan command.

func NewPlan

func NewPlan(args arguments.ViewOptions, view *View) Plan

NewPlan returns an initialized Plan implementation for the given ViewType.

type PlanHuman

type PlanHuman struct {
	// contains filtered or unexported fields
}

The PlanHuman implementation renders human-readable text logs, suitable for a scrolling terminal.

func (*PlanHuman) Diagnostics

func (v *PlanHuman) Diagnostics(diags tfdiags.Diagnostics)

func (*PlanHuman) HelpPrompt

func (v *PlanHuman) HelpPrompt()

func (*PlanHuman) Hooks

func (v *PlanHuman) Hooks() []ghoten.Hook

func (*PlanHuman) Operation

func (v *PlanHuman) Operation() Operation

type PlanJSON

type PlanJSON struct {
	// contains filtered or unexported fields
}

The PlanJSON implementation renders streaming JSON logs, suitable for integrating with other software.

func (*PlanJSON) Diagnostics

func (v *PlanJSON) Diagnostics(diags tfdiags.Diagnostics)

func (*PlanJSON) HelpPrompt

func (v *PlanJSON) HelpPrompt()

func (*PlanJSON) Hooks

func (v *PlanJSON) Hooks() []ghoten.Hook

func (*PlanJSON) Operation

func (v *PlanJSON) Operation() Operation

type PlanMulti

type PlanMulti []Plan

func (PlanMulti) Diagnostics

func (m PlanMulti) Diagnostics(diags tfdiags.Diagnostics)

func (PlanMulti) HelpPrompt

func (m PlanMulti) HelpPrompt()

func (PlanMulti) Hooks

func (m PlanMulti) Hooks() []ghoten.Hook

func (PlanMulti) Operation

func (m PlanMulti) Operation() Operation

type Refresh

type Refresh interface {
	Outputs(outputValues map[string]*states.OutputValue)

	Operation() Operation
	Hooks() []ghoten.Hook

	Diagnostics(diags tfdiags.Diagnostics)
	HelpPrompt()
}

The Refresh view is used for the refresh command.

func NewRefresh

func NewRefresh(args arguments.ViewOptions, view *View) Refresh

NewRefresh returns an initialized Refresh implementation for the given ViewType.

type RefreshHuman

type RefreshHuman struct {
	// contains filtered or unexported fields
}

The RefreshHuman implementation renders human-readable text logs, suitable for a scrolling terminal.

func (*RefreshHuman) Diagnostics

func (v *RefreshHuman) Diagnostics(diags tfdiags.Diagnostics)

func (*RefreshHuman) HelpPrompt

func (v *RefreshHuman) HelpPrompt()

func (*RefreshHuman) Hooks

func (v *RefreshHuman) Hooks() []ghoten.Hook

func (*RefreshHuman) Operation

func (v *RefreshHuman) Operation() Operation

func (*RefreshHuman) Outputs

func (v *RefreshHuman) Outputs(outputValues map[string]*states.OutputValue)

type RefreshJSON

type RefreshJSON struct {
	// contains filtered or unexported fields
}

The RefreshJSON implementation renders streaming JSON logs, suitable for integrating with other software.

func (*RefreshJSON) Diagnostics

func (v *RefreshJSON) Diagnostics(diags tfdiags.Diagnostics)

func (*RefreshJSON) HelpPrompt

func (v *RefreshJSON) HelpPrompt()

func (*RefreshJSON) Hooks

func (v *RefreshJSON) Hooks() []ghoten.Hook

func (*RefreshJSON) Operation

func (v *RefreshJSON) Operation() Operation

func (*RefreshJSON) Outputs

func (v *RefreshJSON) Outputs(outputValues map[string]*states.OutputValue)

type RefreshMulti

type RefreshMulti []Refresh

func (RefreshMulti) Diagnostics

func (m RefreshMulti) Diagnostics(diags tfdiags.Diagnostics)

func (RefreshMulti) HelpPrompt

func (m RefreshMulti) HelpPrompt()

func (RefreshMulti) Hooks

func (m RefreshMulti) Hooks() []ghoten.Hook

func (RefreshMulti) Operation

func (m RefreshMulti) Operation() Operation

func (RefreshMulti) Outputs

func (m RefreshMulti) Outputs(outputValues map[string]*states.OutputValue)

type Show

type Show interface {
	// DisplayState renders the given state snapshot, returning a status code for "ghoten show" to return.
	DisplayState(ctx context.Context, stateFile *statefile.File, schemas *ghoten.Schemas) int

	// DisplayPlan renders the given plan, returning a status code for "ghoten show" to return.
	//
	// Unfortunately there are two possible ways to represent a plan:
	// - Locally-generated plans are loaded as *plans.Plan.
	// - Remotely-generated plans (using remote operations) are loaded as *cloudplan.RemotePlanJSON.
	//
	// Therefore the implementation of this method must handle both cases,
	// preferring planJSON if it is not nil and using plan otherwise.
	DisplayPlan(ctx context.Context, plan *plans.Plan, planJSON *cloudplan.RemotePlanJSON, config *configs.Config, priorStateFile *statefile.File, schemas *ghoten.Schemas) int

	// DisplayConfig renders the given configuration, returning a status code for "ghoten show" to return.
	DisplayConfig(config *configs.Config, schemas *ghoten.Schemas) int

	// DisplaySingleModule renders just one module, in a format that's a subset
	// of that used by [Show.DisplayConfig] which we can produce without
	// schema or child module information.
	DisplaySingleModule(module *configs.Module) int

	// Diagnostics renders early diagnostics, resulting from argument parsing.
	Diagnostics(diags tfdiags.Diagnostics)
}

func NewShow

func NewShow(args arguments.ViewOptions, view *View) Show

type ShowHuman

type ShowHuman struct {
	// contains filtered or unexported fields
}

func (*ShowHuman) Diagnostics

func (v *ShowHuman) Diagnostics(diags tfdiags.Diagnostics)

func (*ShowHuman) DisplayConfig

func (v *ShowHuman) DisplayConfig(config *configs.Config, schemas *ghoten.Schemas) int

func (*ShowHuman) DisplayPlan

func (v *ShowHuman) DisplayPlan(_ context.Context, plan *plans.Plan, planJSON *cloudplan.RemotePlanJSON, config *configs.Config, priorStateFile *statefile.File, schemas *ghoten.Schemas) int

func (*ShowHuman) DisplaySingleModule

func (v *ShowHuman) DisplaySingleModule(_ *configs.Module) int

func (*ShowHuman) DisplayState

func (v *ShowHuman) DisplayState(_ context.Context, stateFile *statefile.File, schemas *ghoten.Schemas) int

type ShowJSON

type ShowJSON struct {
	// contains filtered or unexported fields
}

func (*ShowJSON) Diagnostics

func (v *ShowJSON) Diagnostics(diags tfdiags.Diagnostics)

Diagnostics should only be called if show cannot be executed. In this case, we choose to render human-readable diagnostic output, primarily for backwards compatibility.

func (*ShowJSON) DisplayConfig

func (v *ShowJSON) DisplayConfig(config *configs.Config, schemas *ghoten.Schemas) int

func (*ShowJSON) DisplayPlan

func (v *ShowJSON) DisplayPlan(_ context.Context, plan *plans.Plan, planJSON *cloudplan.RemotePlanJSON, config *configs.Config, priorStateFile *statefile.File, schemas *ghoten.Schemas) int

func (*ShowJSON) DisplaySingleModule

func (v *ShowJSON) DisplaySingleModule(module *configs.Module) int

func (*ShowJSON) DisplayState

func (v *ShowJSON) DisplayState(_ context.Context, stateFile *statefile.File, schemas *ghoten.Schemas) int

type ShowMulti

type ShowMulti []Show

func (ShowMulti) Diagnostics

func (m ShowMulti) Diagnostics(diags tfdiags.Diagnostics)

func (ShowMulti) DisplayConfig

func (m ShowMulti) DisplayConfig(config *configs.Config, schemas *ghoten.Schemas) int

func (ShowMulti) DisplayPlan

func (m ShowMulti) DisplayPlan(ctx context.Context, plan *plans.Plan, planJSON *cloudplan.RemotePlanJSON, config *configs.Config, priorStateFile *statefile.File, schemas *ghoten.Schemas) int

func (ShowMulti) DisplaySingleModule

func (m ShowMulti) DisplaySingleModule(module *configs.Module) int

func (ShowMulti) DisplayState

func (m ShowMulti) DisplayState(ctx context.Context, stateFile *statefile.File, schemas *ghoten.Schemas) int

type StateLocker

type StateLocker interface {
	Locking()
	Unlocking()
}

The StateLocker view is used to display locking/unlocking status messages if the state lock process takes longer than expected.

func NewStateLocker

func NewStateLocker(args arguments.ViewOptions, view *View) StateLocker

NewStateLocker returns an initialized StateLocker implementation for the given ViewType.

type StateLockerHuman

type StateLockerHuman struct {
	// contains filtered or unexported fields
}

StateLockerHuman is an implementation of StateLocker which prints status to a terminal.

func (*StateLockerHuman) Locking

func (v *StateLockerHuman) Locking()

func (*StateLockerHuman) Unlocking

func (v *StateLockerHuman) Unlocking()

type StateLockerJSON

type StateLockerJSON struct {
	// contains filtered or unexported fields
}

StateLockerJSON is an implementation of StateLocker which prints the state lock status to a terminal in machine-readable JSON form.

func (*StateLockerJSON) Locking

func (v *StateLockerJSON) Locking()

func (*StateLockerJSON) Unlocking

func (v *StateLockerJSON) Unlocking()

type StateLockerMulti

type StateLockerMulti []StateLocker

func (StateLockerMulti) Locking

func (m StateLockerMulti) Locking()

func (StateLockerMulti) Unlocking

func (m StateLockerMulti) Unlocking()

type Test

type Test interface {
	// Abstract should print an early summary of the tests that will be
	// executed. This will be called before the tests have been executed so
	// the status for everything within suite will be test.Pending.
	//
	// This should be used to state what is going to be tested.
	Abstract(suite *moduletest.Suite)

	// Conclusion should print out a summary of the tests including their
	// completed status.
	Conclusion(suite *moduletest.Suite)

	// File prints out the summary for an entire test file.
	File(file *moduletest.File)

	// Run prints out the summary for a single test run block.
	Run(run *moduletest.Run, file *moduletest.File)

	// DestroySummary prints out the summary of the destroy step of each test
	// file. If everything goes well, this should be empty.
	DestroySummary(diags tfdiags.Diagnostics, run *moduletest.Run, file *moduletest.File, state *states.State)

	// Diagnostics prints out the provided diagnostics.
	Diagnostics(run *moduletest.Run, file *moduletest.File, diags tfdiags.Diagnostics)

	// Interrupted prints out a message stating that an interrupt has been
	// received and testing will stop.
	Interrupted()

	// FatalInterrupt prints out a message stating that a hard interrupt has
	// been received and testing will stop and cleanup will be skipped.
	FatalInterrupt()

	// FatalInterruptSummary prints out the resources that were held in state
	// and were being created at the time the FatalInterrupt was received.
	//
	// This will typically be called in place of DestroySummary, as there is no
	// guarantee that this function will be called during a FatalInterrupt. In
	// addition, this function prints additional details about the current
	// operation alongside the current state as the state will be missing newly
	// created resources that also need to be handled manually.
	FatalInterruptSummary(run *moduletest.Run, file *moduletest.File, states map[*moduletest.Run]*states.State, created []*plans.ResourceInstanceChangeSrc)
}

Test renders outputs for test executions.

func NewTest

func NewTest(args arguments.ViewOptions, view *View) Test

type TestHuman

type TestHuman struct {
	// contains filtered or unexported fields
}

func (*TestHuman) Abstract

func (t *TestHuman) Abstract(_ *moduletest.Suite)

func (*TestHuman) Conclusion

func (t *TestHuman) Conclusion(suite *moduletest.Suite)

func (*TestHuman) DestroySummary

func (t *TestHuman) DestroySummary(diags tfdiags.Diagnostics, run *moduletest.Run, file *moduletest.File, state *states.State)

func (*TestHuman) Diagnostics

func (t *TestHuman) Diagnostics(_ *moduletest.Run, _ *moduletest.File, diags tfdiags.Diagnostics)

func (*TestHuman) FatalInterrupt

func (t *TestHuman) FatalInterrupt()

func (*TestHuman) FatalInterruptSummary

func (t *TestHuman) FatalInterruptSummary(run *moduletest.Run, file *moduletest.File, existingStates map[*moduletest.Run]*states.State, created []*plans.ResourceInstanceChangeSrc)

func (*TestHuman) File

func (t *TestHuman) File(file *moduletest.File)

func (*TestHuman) Interrupted

func (t *TestHuman) Interrupted()

func (*TestHuman) Run

func (t *TestHuman) Run(run *moduletest.Run, file *moduletest.File)

type TestJSON

type TestJSON struct {
	// contains filtered or unexported fields
}

func (*TestJSON) Abstract

func (t *TestJSON) Abstract(suite *moduletest.Suite)

func (*TestJSON) Conclusion

func (t *TestJSON) Conclusion(suite *moduletest.Suite)

func (*TestJSON) DestroySummary

func (t *TestJSON) DestroySummary(diags tfdiags.Diagnostics, run *moduletest.Run, file *moduletest.File, state *states.State)

func (*TestJSON) Diagnostics

func (t *TestJSON) Diagnostics(run *moduletest.Run, file *moduletest.File, diags tfdiags.Diagnostics)

func (*TestJSON) FatalInterrupt

func (t *TestJSON) FatalInterrupt()

func (*TestJSON) FatalInterruptSummary

func (t *TestJSON) FatalInterruptSummary(run *moduletest.Run, file *moduletest.File, existingStates map[*moduletest.Run]*states.State, created []*plans.ResourceInstanceChangeSrc)

func (*TestJSON) File

func (t *TestJSON) File(file *moduletest.File)

func (*TestJSON) Interrupted

func (t *TestJSON) Interrupted()

func (*TestJSON) Run

func (t *TestJSON) Run(run *moduletest.Run, file *moduletest.File)

type TestMulti

type TestMulti []Test

func (TestMulti) Abstract

func (m TestMulti) Abstract(suite *moduletest.Suite)

func (TestMulti) Conclusion

func (m TestMulti) Conclusion(suite *moduletest.Suite)

func (TestMulti) DestroySummary

func (m TestMulti) DestroySummary(diags tfdiags.Diagnostics, run *moduletest.Run, file *moduletest.File, state *states.State)

func (TestMulti) Diagnostics

func (m TestMulti) Diagnostics(run *moduletest.Run, file *moduletest.File, diags tfdiags.Diagnostics)

func (TestMulti) FatalInterrupt

func (m TestMulti) FatalInterrupt()

func (TestMulti) FatalInterruptSummary

func (m TestMulti) FatalInterruptSummary(run *moduletest.Run, file *moduletest.File, states map[*moduletest.Run]*states.State, created []*plans.ResourceInstanceChangeSrc)

func (TestMulti) File

func (m TestMulti) File(file *moduletest.File)

func (TestMulti) Interrupted

func (m TestMulti) Interrupted()

func (TestMulti) Run

func (m TestMulti) Run(run *moduletest.Run, file *moduletest.File)

type UiHook

type UiHook struct {
	ghoten.NilHook
	// contains filtered or unexported fields
}

func NewUiHook

func NewUiHook(view *View) *UiHook

func (*UiHook) Deferred

func (h *UiHook) Deferred(addr addrs.AbsResourceInstance, reason string) (ghoten.HookAction, error)

func (*UiHook) PostApply

func (h *UiHook) PostApply(addr addrs.AbsResourceInstance, gen states.Generation, newState cty.Value, applyerr error) (ghoten.HookAction, error)

func (*UiHook) PostApplyImport

func (h *UiHook) PostApplyImport(addr addrs.AbsResourceInstance, importing plans.ImportingSrc) (ghoten.HookAction, error)

func (*UiHook) PostClose

func (h *UiHook) PostClose(addr addrs.AbsResourceInstance, _ error) (ghoten.HookAction, error)

func (*UiHook) PostImportState

func (h *UiHook) PostImportState(addr addrs.AbsResourceInstance, imported []providers.ImportedResource) (ghoten.HookAction, error)

func (*UiHook) PostOpen

func (h *UiHook) PostOpen(addr addrs.AbsResourceInstance, _ error) (ghoten.HookAction, error)

func (*UiHook) PostRenew

func (h *UiHook) PostRenew(addr addrs.AbsResourceInstance, _ error) (ghoten.HookAction, error)

func (*UiHook) PreApply

func (h *UiHook) PreApply(addr addrs.AbsResourceInstance, gen states.Generation, action plans.Action, priorState, plannedNewState cty.Value) (ghoten.HookAction, error)

func (*UiHook) PreApplyImport

func (h *UiHook) PreApplyImport(addr addrs.AbsResourceInstance, importing plans.ImportingSrc) (ghoten.HookAction, error)

func (*UiHook) PreClose

func (h *UiHook) PreClose(addr addrs.AbsResourceInstance) (ghoten.HookAction, error)

func (*UiHook) PreImportState

func (h *UiHook) PreImportState(addr addrs.AbsResourceInstance, importID string) (ghoten.HookAction, error)

func (*UiHook) PreOpen

func (h *UiHook) PreOpen(addr addrs.AbsResourceInstance) (ghoten.HookAction, error)

func (*UiHook) PrePlanImport

func (h *UiHook) PrePlanImport(addr addrs.AbsResourceInstance, importID string) (ghoten.HookAction, error)

func (*UiHook) PreProvisionInstanceStep

func (h *UiHook) PreProvisionInstanceStep(addr addrs.AbsResourceInstance, typeName string) (ghoten.HookAction, error)

func (*UiHook) PreRefresh

func (h *UiHook) PreRefresh(addr addrs.AbsResourceInstance, gen states.Generation, priorState cty.Value) (ghoten.HookAction, error)

func (*UiHook) PreRenew

func (h *UiHook) PreRenew(addr addrs.AbsResourceInstance) (ghoten.HookAction, error)

func (*UiHook) ProvisionOutput

func (h *UiHook) ProvisionOutput(addr addrs.AbsResourceInstance, typeName string, msg string)

type Validate

type Validate interface {
	// Results renders the diagnostics returned from a validation walk, and
	// returns a CLI exit code: 0 if there are no errors, 1 otherwise
	Results(diags tfdiags.Diagnostics) int

	// Diagnostics renders early diagnostics, resulting from argument parsing.
	Diagnostics(diags tfdiags.Diagnostics)
}

The Validate is used for the validate command.

func NewValidate

func NewValidate(args arguments.ViewOptions, view *View) Validate

NewValidate returns an initialized Validate implementation for the given ViewType.

type ValidateHuman

type ValidateHuman struct {
	// contains filtered or unexported fields
}

The ValidateHuman implementation renders diagnostics in a human-readable form, along with a success/failure message if Ghoten is able to execute the validation walk.

func (*ValidateHuman) Diagnostics

func (v *ValidateHuman) Diagnostics(diags tfdiags.Diagnostics)

func (*ValidateHuman) Results

func (v *ValidateHuman) Results(diags tfdiags.Diagnostics) int

type ValidateJSON

type ValidateJSON struct {
	// contains filtered or unexported fields
}

The ValidateJSON implementation renders validation results as a JSON object. This object includes top-level fields summarizing the result, and an array of JSON diagnostic objects.

func (*ValidateJSON) Diagnostics

func (v *ValidateJSON) Diagnostics(diags tfdiags.Diagnostics)

Diagnostics should only be called if the validation walk cannot be executed. In this case, we choose to render human-readable diagnostic output, primarily for backwards compatibility.

func (*ValidateJSON) Results

func (v *ValidateJSON) Results(diags tfdiags.Diagnostics) int

type ValidateMulti

type ValidateMulti []Validate

func (ValidateMulti) Diagnostics

func (m ValidateMulti) Diagnostics(diags tfdiags.Diagnostics)

Diagnostics renders early diagnostics, resulting from argument parsing.

func (ValidateMulti) Results

func (m ValidateMulti) Results(diags tfdiags.Diagnostics) int

Results renders the diagnostics returned from a validation walk, and returns a CLI exit code: 0 if there are no errors, 1 otherwise

type View

type View struct {

	// ModuleDeprecationWarnLvl is used to filter out deprecation warnings for outputs and variables as requested by the user.
	ModuleDeprecationWarnLvl ghoten.DeprecationWarningLevel
	// contains filtered or unexported fields
}

View is the base layer for command views, encapsulating a set of I/O streams, a colorize implementation, and implementing a human friendly view for diagnostics.

func NewView

func NewView(streams *terminal.Streams) *View

Initialize a View with the given streams, a disabled colorize object, and a no-op configSources callback.

func (*View) Configure

func (v *View) Configure(view *arguments.View)

Configure applies the global view configuration flags.

func (*View) Diagnostics

func (v *View) Diagnostics(diags tfdiags.Diagnostics)

Diagnostics renders a set of warnings and errors in human-readable form. Warnings are printed to stdout, and errors to stderr.

func (*View) DiagsWithNewline

func (v *View) DiagsWithNewline()

func (*View) HelpPrompt

func (v *View) HelpPrompt(command string)

HelpPrompt is intended to be called from commands which fail to parse all of their CLI arguments successfully. It refers users to the full help output rather than rendering it directly, which can be overwhelming and confusing.

func (*View) RunningInAutomation

func (v *View) RunningInAutomation() bool

func (*View) SetConfigSources

func (v *View) SetConfigSources(cb func() map[string]*hcl.File)

SetConfigSources overrides the default no-op callback with a new function pointer, and should be called when the config loader is initialized.

func (*View) SetRunningInAutomation

func (v *View) SetRunningInAutomation(new bool) *View

SetRunningInAutomation modifies the view's "running in automation" flag, which causes some slight adjustments to certain messages that would normally suggest specific Ghoten commands to run, to make more conceptual gestures instead for situations where the user isn't running Ghoten directly.

For convenient use during initialization (in conjunction with NewView), SetRunningInAutomation returns the receiver after modifying it.

func (*View) SetShowSensitive

func (v *View) SetShowSensitive(showSensitive bool)

type ViewUiHuman

type ViewUiHuman struct {
	// contains filtered or unexported fields
}

ViewUiHuman is a Ui implementation that colors its output according to the given color schemes for the given type of output.

func (*ViewUiHuman) Ask

func (u *ViewUiHuman) Ask(query string) (string, error)

func (*ViewUiHuman) AskSecret

func (u *ViewUiHuman) AskSecret(query string) (string, error)

func (*ViewUiHuman) Error

func (u *ViewUiHuman) Error(message string)

func (*ViewUiHuman) Info

func (u *ViewUiHuman) Info(message string)

func (*ViewUiHuman) Output

func (u *ViewUiHuman) Output(message string)

func (*ViewUiHuman) Warn

func (u *ViewUiHuman) Warn(message string)

type ViewUiJSON

type ViewUiJSON struct {
	// contains filtered or unexported fields
}

ViewUiJSON is a Ui implementation that colors its output according to the given color schemes for the given type of output.

func (*ViewUiJSON) Ask

func (u *ViewUiJSON) Ask(_ string) (string, error)

func (*ViewUiJSON) AskSecret

func (u *ViewUiJSON) AskSecret(_ string) (string, error)

func (*ViewUiJSON) Error

func (u *ViewUiJSON) Error(message string)

func (*ViewUiJSON) Info

func (u *ViewUiJSON) Info(message string)

func (*ViewUiJSON) Output

func (u *ViewUiJSON) Output(message string)

func (*ViewUiJSON) Warn

func (u *ViewUiJSON) Warn(message string)

type ViewUiMulti

type ViewUiMulti []cli.Ui

ViewUiMulti is a Ui implementation that colors its output according to the given color schemes for the given type of output.

func (ViewUiMulti) Ask

func (u ViewUiMulti) Ask(query string) (string, error)

func (ViewUiMulti) AskSecret

func (u ViewUiMulti) AskSecret(query string) (string, error)

func (ViewUiMulti) Error

func (u ViewUiMulti) Error(message string)

func (ViewUiMulti) Info

func (u ViewUiMulti) Info(message string)

func (ViewUiMulti) Output

func (u ViewUiMulti) Output(message string)

func (ViewUiMulti) Warn

func (u ViewUiMulti) Warn(message string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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