format

package
v0.1.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DIRECTORY_WRITE_PERMISSIONS = 0700
View Source
const FILE_WRITE_PERMISSIONS = 0600

Variables

View Source
var YAMLNodeKinds = map[yaml.Kind]string{
	yaml.DocumentNode: "Document",
	yaml.SequenceNode: "Sequence",
	yaml.MappingNode:  "Mapping",
	yaml.ScalarNode:   "Scalar",
	yaml.AliasNode:    "Alias",
}

Functions

func DumpYAMLNode added in v0.1.18

func DumpYAMLNode(writer io.Writer, node *yaml.Node, indent int)

func DumpYAMLNodes added in v0.1.18

func DumpYAMLNodes(writer io.Writer, node *yaml.Node)

func Encode

func Encode(value interface{}, format string, indent string, strict bool) (string, error)

func EncodeCBOR added in v0.1.20

func EncodeCBOR(value interface{}) (string, error)

Encodes to Base64

func EncodeCompatibleJSON added in v0.1.15

func EncodeCompatibleJSON(value interface{}, indent string) (string, error)

func EncodeCompatibleXML added in v0.1.18

func EncodeCompatibleXML(value interface{}, indent string) (string, error)

func EncodeJSON

func EncodeJSON(value interface{}, indent string) (string, error)

func EncodeYAML

func EncodeYAML(value interface{}, indent string, strict bool) (string, error)

func NewJSONFormatter added in v0.1.27

func NewJSONFormatter() *prettyjson.Formatter

func NewYAMLPrinter added in v0.1.27

func NewYAMLPrinter() yamlprinter.Printer

func OpenFileForWrite

func OpenFileForWrite(path string) (*os.File, error)

func PrettifyYAML added in v0.1.26

func PrettifyYAML(code string, writer io.Writer) error

func Print

func Print(value interface{}, format string, writer io.Writer, strict bool, pretty bool) error

func PrintCBOR added in v0.1.20

func PrintCBOR(value interface{}, writer io.Writer) error

func PrintCompatibleJSON added in v0.1.15

func PrintCompatibleJSON(value interface{}, writer io.Writer, pretty bool) error

func PrintCompatibleXML added in v0.1.18

func PrintCompatibleXML(value interface{}, writer io.Writer, pretty bool) error

func PrintJSON

func PrintJSON(value interface{}, writer io.Writer, pretty bool) error

func PrintXMLDocument

func PrintXMLDocument(xmlDocument *etree.Document, writer io.Writer, pretty bool) error

func PrintYAML

func PrintYAML(value interface{}, writer io.Writer, strict bool, pretty bool) error

func Validate

func Validate(code string, format string) error

func ValidateCBOR added in v0.1.21

func ValidateCBOR(code string) error

func ValidateJSON

func ValidateJSON(code string) error

func ValidateXML

func ValidateXML(code string) error

func ValidateYAML

func ValidateYAML(code string) error

func Write

func Write(value interface{}, format string, indent string, strict bool, writer io.Writer) error

func WriteCBOR added in v0.1.20

func WriteCBOR(value interface{}, writer io.Writer) error

func WriteCompatibleJSON added in v0.1.15

func WriteCompatibleJSON(value interface{}, writer io.Writer, indent string) error

func WriteCompatibleXML added in v0.1.18

func WriteCompatibleXML(value interface{}, writer io.Writer, indent string) error

func WriteJSON

func WriteJSON(value interface{}, writer io.Writer, indent string) error

func WriteOrPrint

func WriteOrPrint(value interface{}, format string, writer io.Writer, strict bool, pretty bool, output string) error

func WriteXMLDocument

func WriteXMLDocument(xmlDocument *etree.Document, writer io.Writer, indent string) error

func WriteYAML

func WriteYAML(value interface{}, writer io.Writer, indent string, strict bool) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL