addr

package
v0.0.0-...-4add889 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoEachIndex = EachIndex(nil)

NoIndex is a nil value of type EachIndex that is used when ForEach is not in use, to represent the absense of an index.

Functions

func ValidName

func ValidName(name string) bool

Types

type EachIndex

type EachIndex interface {
	EachType() EachType
	Value() cty.Value
	String() string
}

EachIndex represents an index for an instance of a configuration structure that supports ForEach.

EachInt and EachString represent integer and string indices respectively. Which type is used depends on whether ForEach is assigned a list or a map.

A nil EachIndex represents no index at all, which us used when ForEach is not set.

func MakeEachIndex

func MakeEachIndex(val cty.Value) EachIndex

MakeEachIndex takes a cty.Value of either cty.Number or cty.String and produces the equivalent EachIndex.

This function will return NoEachIndex if the given value is not of a suitable type or if it not convertable to an int. It will panic if the value is unknown or null.

type EachInt

type EachInt int

func (EachInt) EachType

func (i EachInt) EachType() EachType

func (EachInt) String

func (i EachInt) String() string

func (EachInt) Value

func (i EachInt) Value() cty.Value

type EachString

type EachString string

func (EachString) EachType

func (s EachString) EachType() EachType

func (EachString) String

func (s EachString) String() string

func (EachString) Value

func (s EachString) Value() cty.Value

type EachType

type EachType rune
const (
	NoEach         EachType = 0
	EachTypeInt    EachType = 'i'
	EachTypeString EachType = 's'
)

func (EachType) String

func (i EachType) String() string

type ModulePath

type ModulePath []ModulePathStep
var RootModulePath ModulePath

RootModulePath is a ModulePath representing the root module

func (ModulePath) AppendIndex

func (m ModulePath) AppendIndex(key EachIndex) ModulePath

func (ModulePath) AppendName

func (m ModulePath) AppendName(name string) ModulePath

func (ModulePath) IsRoot

func (m ModulePath) IsRoot() bool

func (ModulePath) NearestName

func (m ModulePath) NearestName() ModulePath

func (ModulePath) Parent

func (m ModulePath) Parent() ModulePath

func (ModulePath) String

func (m ModulePath) String() string

type ModulePathStep

type ModulePathStep interface {
	// contains filtered or unexported methods
}

type NameInModule

type NameInModule struct {
	Module ModulePath
	Name   string
	Key    EachIndex
}

NameInModule is a tuple of a module path, a name defined within that module, an an optional index into the referenced object for objects that support ForEach. The Key field is NoEachIndex when no index is selected, or will otherwise be an EachInt or EachString value.

func (NameInModule) ID

func (n NameInModule) ID() string

ID returns an opaque string that uniquely identifies the recieving qualified name using only alphanumeric characters, suitable for use as a resource identifier in CloudFormation template JSON.

The result is not intelligible to humans, so objects using such ids should generally be annotated with a human-readable form too so that users can map generated objects back onto the source construct that created them.

func (NameInModule) String

func (n NameInModule) String() string

Jump to

Keyboard shortcuts

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