Documentation ¶
Overview ¶
Package prettyjson provides JSON pretty print. Below code is Inspired from https://github.com/hokaccha/go-prettyjson
Index ¶
- Constants
- Variables
- func Format(data []byte) ([]byte, error)
- func Marshal(v interface{}) ([]byte, error)
- type Formatter
- type HTMLWriter
- type JSONWriter
- type JsonSumWriter
- type SeparateTree
- type TableWriter
- type TreeWriter
- type Writer
- func CreateWriter(tree, separateTree, drawable, mdEnabled, json, html bool, jsonSum bool, ...) Writer
- func NewHTMLWriter(changes map[string]terraformstate.ResourceChanges, ...) Writer
- func NewJSONWriter(changes terraformstate.ResourceChanges) Writer
- func NewJsonSumWriter(changes map[string]terraformstate.ResourceChanges) Writer
- func NewSeparateTree(changes map[string]terraformstate.ResourceChanges, drawable bool) Writer
- func NewTableWriter(changes map[string]terraformstate.ResourceChanges, ...) Writer
- func NewTreeWriter(changes terraformstate.ResourceChanges, drawable bool) Writer
Constants ¶
View Source
const SEPARATOR = "###################"
Variables ¶
View Source
var NewTreeWriterFunc = NewTreeWriter
Functions ¶
Types ¶
type Formatter ¶
type Formatter struct { AddColor *color.Color RemoveColor *color.Color UpdateColor *color.Color RecreateColor *color.Color ImportColor *color.Color StringMaxLength int Indent int Newline string }
func NewFormatter ¶
func NewFormatter() *Formatter
NewFormatter returns a new formatter with following default values.
type HTMLWriter ¶ added in v0.3.8
type HTMLWriter struct { ResourceChanges map[string]terraformstate.ResourceChanges OutputChanges map[string][]string }
HTMLWriter is a Writer that writes HTML.
type JSONWriter ¶ added in v0.3.0
type JSONWriter struct {
// contains filtered or unexported fields
}
type JsonSumWriter ¶ added in v0.3.12
type JsonSumWriter struct {
// contains filtered or unexported fields
}
type SeparateTree ¶
type SeparateTree struct {
// contains filtered or unexported fields
}
type TableWriter ¶
type TableWriter struct {
// contains filtered or unexported fields
}
type TreeWriter ¶
type TreeWriter struct {
// contains filtered or unexported fields
}
type Writer ¶
func CreateWriter ¶
func NewHTMLWriter ¶ added in v0.3.8
func NewHTMLWriter(changes map[string]terraformstate.ResourceChanges, outputChanges map[string][]string) Writer
NewHTMLWriter returns a new HTMLWriter with the configuration it's passed.
func NewJSONWriter ¶ added in v0.3.0
func NewJSONWriter(changes terraformstate.ResourceChanges) Writer
func NewJsonSumWriter ¶ added in v0.3.12
func NewJsonSumWriter(changes map[string]terraformstate.ResourceChanges) Writer
func NewSeparateTree ¶
func NewSeparateTree(changes map[string]terraformstate.ResourceChanges, drawable bool) Writer
func NewTableWriter ¶
func NewTableWriter(changes map[string]terraformstate.ResourceChanges, outputChanges map[string][]string, mdEnabled bool) Writer
func NewTreeWriter ¶
func NewTreeWriter(changes terraformstate.ResourceChanges, drawable bool) Writer
Click to show internal directories.
Click to hide internal directories.