Documentation ¶
Overview ¶
Package format contains functionality to render a cft.Template into YAML or JSON
Index ¶
- Constants
- Variables
- func CftToPkl(t cft.Template, basic bool, pklPackageAlias string) (string, error)
- func CftToYaml(t cft.Template) string
- func CheckMultilineBegin(s string) bool
- func Jsonise(node *yaml.Node) interface{}
- func PrettyPrint(i interface{}) string
- func String(t cft.Template, opt Options) string
- func ToJson(i interface{}, indent string) ([]byte, error)
- type MapItem
- type MapSlice
- type Options
Constants ¶
View Source
const ( SUB = "Fn::Sub" REF = "Ref" GETATT = "Fn::GetAtt" EQUALS = "Fn::Equals" CONTAINS = "Fn::Contains" FINDINMAP = "Fn::FindInMap" GETAZS = "Fn::GetAZs" SELECT = "Fn::Select" SPLIT = "Fn::Split" )
Variables ¶
View Source
var NodeStyle string
Global, set by command arg --node-style
View Source
var NodeStyleDocs = "Set the node output style to tagged, doublequoted, singlequoted, literal, folded, quotescalars, original, or flow"
Functions ¶
func CftToPkl ¶ added in v1.8.2
CftToPkl serializes the template as pkl. It assumes that the user is importing the cloudformation package
func CheckMultilineBegin ¶ added in v1.6.0
func PrettyPrint ¶ added in v1.3.0
func PrettyPrint(i interface{}) string
converts struct to a JSON formatted string
Types ¶
type MapItem ¶ added in v1.7.5
type MapItem struct {
Key, Value interface{}
// contains filtered or unexported fields
}
MapItem representation of one map item.
func (*MapItem) UnmarshalJSON ¶ added in v1.7.5
UnmarshalJSON for map item.
type MapSlice ¶ added in v1.7.5
type MapSlice []MapItem
MapSlice of map items.
func (MapSlice) MarshalJSON ¶ added in v1.7.5
MarshalJSON for map slice.
func (*MapSlice) UnmarshalJSON ¶ added in v1.7.5
UnmarshalJSON for map slice.
type Options ¶
type Options struct { // JSON determines whether the outputs will be JSON (true) or YAML (false) JSON bool // Unsorted will cause the formatter to leave the ordering of template elements // as in the original template if true. // If false, the formatter will rearrange the template elements into // canonical order. Unsorted bool }
Options contains options for formatting cfn templates
Click to show internal directories.
Click to hide internal directories.