intrinsicsolver

package
v0.0.0-...-a4d1c73 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Functions = []string{"Base64", "GetAtt", "GetAZs", "ImportValue", "Ref", "FindInMap", "Join", "Select", "Split", "Sub", "And", "Equals", "If", "Not", "Or"}

Functions

func FixFunctions

func FixFunctions(template []byte, logger logger.LoggerInt, mode ...string) ([]byte, error)

FixFunctions : takes []byte file and firstly converts all single quotation marks to double ones (anything between single ones is treated as the rune in GoLang), then deconstructs file into lines, checks for intrinsic functions. The FixFunctions has modes: `multiline`, `elongate` and `correctlong`. Mode `multiline` looks for functions of a map nature where the function name is located in one line and it's body (map elements) are located in the following lines (if this would be not fixed an error would be thrown: `json: unsupported type: map[interface {}]interface {}`). The function changes the notation by putting function name in the next line with proper indentation. Mode `elongate` exchanges the short function names into their proper, long equivalent. Mode `correctlong` prepares the file for conversion into JSON. If the file is a YAML with every line being solicitously indented, there is no problem and the `elongate` mode is all we need. But if there is any mixed notation (e.g. indented maps along with one-line maps, functions in one line with the key), parsing must be preceded with some additional operations. The result is returned as a []byte array.

func SplitLinesIfNestedFunction

func SplitLinesIfNestedFunction(split []string, line *string, newFunctionForm string, lines *[]string, idx int) string

SplitLinesIfNestedFunction parses functions to form which CloudFormation parser can read properly - adding indent and moving next function to new line.

Types

This section is empty.

Jump to

Keyboard shortcuts

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