Documentation ¶
Overview ¶
Package format contains functionality to render a cft.Template into YAML or JSON
Index ¶
- 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 ¶
This section is empty.
Functions ¶
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.