repl

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package repl provides the structs and functions necessary to run REPL for OpenTofu. The REPL allows experimentation of OpenTofu interpolations without having to run a OpenTofu configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatValue

func FormatValue(v cty.Value, indent int) string

FormatValue formats a value in a way that resembles OpenTofu language syntax and uses the type conversion functions where necessary to indicate exactly what type it is given, so that equality test failures can be quickly understood.

Types

type Session

type Session struct {
	// Scope is the evaluation scope where expressions will be evaluated.
	Scope *lang.Scope
}

Session represents the state for a single REPL session.

func (*Session) Handle

func (s *Session) Handle(line string) (string, bool, tfdiags.Diagnostics)

Handle handles a single line of input from the REPL.

This is a stateful operation if a command is given (such as setting a variable). This function should not be called in parallel.

The return value is the output and the error to show.

Jump to

Keyboard shortcuts

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