Documentation ¶
Overview ¶
Package format contains functionality to render a cft.Template into YAML or JSON
Index ¶
- Variables
- func CftToPkl(t cft.Template) (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 ¶
This section is empty.
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"
View Source
var PklPackageAlias string = "@cfn"
Functions ¶
func CftToPkl ¶ added in v1.8.2
CftToPkl serializes the template as pkl. It assumes that the user is import 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.