maps

package
v1.3.0-preview1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2016 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader interface {
	// GetString retrieves a string from the underlying data.
	//
	// If the value does not exist, or is not a string, returns an empty string.
	GetString(key string) string

	// GetStringPtr retrieves a string pointer from the underlying data.
	//
	// If the value does not exist, or is not a string, returns nil.
	GetStringPtr(key string) *string

	// GetInt retrieves an integer from the underlying data.
	//
	// If the value does not exist, or is not an int, returns 0.
	GetInt(key string) int

	// GetInt retrieves an integer from the underlying data, or a default value if not present.
	//
	// If the value does not exist, or is not an int, returns defaultValue.
	GetIntOr(key string, defaultValue int) int

	// GetIntPtr retrieves an integer pointer from the underlying data.
	//
	// If the value does not exist, or is not an int, returns nil.
	GetIntPtr(key string) *int
}

Reader provides an interface for reading from a Terraform value map.

Together, Reader and Writer provider a consistent interface.

func NewReader

func NewReader(data map[string]interface{}) Reader

NewReader creates a new Reader to read the values in the specified map.

type Writer

type Writer interface {
	// SetString creates or updates a string in the underlying data.
	SetString(key string, value string)

	// SetStringPtr creates or updates a string pointer in the underlying data.
	SetStringPtr(key string, value *string)

	// SetInt creates or updates an integer in the underlying data.
	SetInt(key string, value int)

	// SetIntPtr creates or updates an integer pointer in the underlying data.
	SetIntPtr(key string, value *int)
}

Writer provides an interface for writing to a Terraform value map.

ToSether, Reader and Writer provider a consistent interface.

func NewWriter

func NewWriter(data map[string]interface{}) Writer

NewWriter creates a new Writer to read the values in the specified map.

Jump to

Keyboard shortcuts

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