Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Functions = []string{"Base64", "GetAtt", "GetAZs", "ImportValue", "Ref", "FindInMap", "Join", "Select", "Split", "Sub", "And", "Equals", "If", "Not", "Or"}
Functions ¶
func FixFunctions ¶
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.