Documentation ¶
Index ¶
- type Colorer
- type Colorize
- type Remote
- func (b *Remote) CLIInit(opts *backend.CLIOpts) error
- func (b *Remote) Colorize() Colorer
- func (b *Remote) ConfigSchema() *configschema.Block
- func (b *Remote) Configure(obj cty.Value) tfdiags.Diagnostics
- func (b *Remote) Context(op *backend.Operation) (*terraform.Context, statemgr.Full, tfdiags.Diagnostics)
- func (b *Remote) DeleteWorkspace(name string) error
- func (b *Remote) Operation(ctx context.Context, op *backend.Operation) (*backend.RunningOperation, error)
- func (b *Remote) PrepareConfig(obj cty.Value) (cty.Value, tfdiags.Diagnostics)
- func (b *Remote) ReportResult(op *backend.RunningOperation, err error)
- func (b *Remote) StateMgr(name string) (state.State, error)
- func (b *Remote) Workspaces() ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Colorer ¶ added in v0.11.9
Colorer is the interface that must be implemented to colorize strings.
type Colorize ¶ added in v0.11.9
type Colorize struct {
// contains filtered or unexported fields
}
Colorize is used to print output when the -no-color flag is used. It will strip all ANSI escaped color codes which are set while the operation was executed in Terraform Enterprise.
When Terraform Enterprise supports run specific variables, this code can be removed as we can then pass the CLI flag to the backend and prevent the color codes from being written to the output.
type Remote ¶
type Remote struct { // CLI and Colorize control the CLI output. If CLI is nil then no CLI // output will be done. If CLIColor is nil then no coloring will be done. CLI cli.Ui CLIColor *colorstring.Colorize // ShowDiagnostics prints diagnostic messages to the UI. ShowDiagnostics func(vals ...interface{}) // ContextOpts are the base context options to set when initializing a // new Terraform context. Many of these will be overridden or merged by // Operation. See Operation for more details. ContextOpts *terraform.ContextOpts // contains filtered or unexported fields }
Remote is an implementation of EnhancedBackend that performs all operations in a remote backend.
func (*Remote) Colorize ¶
Colorize returns the Colorize structure that can be used for colorizing output. This is guaranteed to always return a non-nil value and so is useful as a helper to wrap any potentially colored strings.
func (*Remote) ConfigSchema ¶ added in v0.12.0
func (b *Remote) ConfigSchema() *configschema.Block
ConfigSchema implements backend.Enhanced.
func (*Remote) Configure ¶
func (b *Remote) Configure(obj cty.Value) tfdiags.Diagnostics
Configure implements backend.Enhanced.
func (*Remote) Context ¶ added in v0.11.12
func (b *Remote) Context(op *backend.Operation) (*terraform.Context, statemgr.Full, tfdiags.Diagnostics)
Context implements backend.Enhanced.
func (*Remote) DeleteWorkspace ¶ added in v0.12.0
DeleteWorkspace implements backend.Enhanced.
func (*Remote) Operation ¶
func (b *Remote) Operation(ctx context.Context, op *backend.Operation) (*backend.RunningOperation, error)
Operation implements backend.Enhanced.
func (*Remote) PrepareConfig ¶ added in v0.12.0
PrepareConfig implements backend.Backend.
func (*Remote) ReportResult ¶ added in v0.12.0
func (b *Remote) ReportResult(op *backend.RunningOperation, err error)
ReportResult is a helper for the common chore of setting the status of a running operation and showing any diagnostics produced during that operation.
If the given diagnostics contains errors then the operation's result will be set to backend.OperationFailure. It will be set to backend.OperationSuccess otherwise. It will then use b.ShowDiagnostics to show the given diagnostics before returning.
Callers should feel free to do each of these operations separately in more complex cases where e.g. diagnostics are interleaved with other output, but terminating immediately after reporting error diagnostics is common and can be expressed concisely via this method.
func (*Remote) Workspaces ¶ added in v0.12.0
Workspaces implements backend.Enhanced.