repl

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2017 License: MPL-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var ErrSessionExit = errors.New("session exit")

ErrSessionExit is a special error result that should be checked for from Handle to signal a graceful exit.

Functions

func FormatResult

func FormatResult(value interface{}) (string, error)

FormatResult formats the given result value for human-readable output.

The value must currently be a string, list, map, and any nested values with those same types.

Types

type Session

type Session struct {
	// Interpolater is used for calculating interpolations
	Interpolater *terraform.Interpolater
}

Session represents the state for a single REPL session.

func (*Session) Handle

func (s *Session) Handle(line string) (string, error)

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