format

package
v0.1.59 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 18 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 any, format string, indent string, strict bool) (string, error)

func EncodeCBOR added in v0.1.20

func EncodeCBOR(value any) (string, error)

Encodes to Base64

func EncodeCompatibleJSON added in v0.1.15

func EncodeCompatibleJSON(value any, indent string) (string, error)

func EncodeCompatibleXML added in v0.1.18

func EncodeCompatibleXML(value any, indent string) (string, error)

func EncodeGo added in v0.1.53

func EncodeGo(value any, indent string) (string, error)

func EncodeJSON

func EncodeJSON(value any, indent string) (string, error)

func EncodeYAML

func EncodeYAML(value any, indent string, strict bool) (string, error)

func NewJSONFormatter added in v0.1.27

func NewJSONFormatter() *prettyjson.Formatter

func NewUtterConfig added in v0.1.53

func NewUtterConfig(indent string) *utter.ConfigState

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 any, format string, writer io.Writer, strict bool, pretty bool) error

func PrintCBOR added in v0.1.20

func PrintCBOR(value any, writer io.Writer) error

func PrintCompatibleJSON added in v0.1.15

func PrintCompatibleJSON(value any, writer io.Writer, pretty bool) error

func PrintCompatibleXML added in v0.1.18

func PrintCompatibleXML(value any, writer io.Writer, pretty bool) error

func PrintGo added in v0.1.53

func PrintGo(value any, writer io.Writer, pretty bool) error

func PrintJSON

func PrintJSON(value any, writer io.Writer, pretty bool) error

func PrintXMLDocument

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

func PrintYAML

func PrintYAML(value any, 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 any, format string, indent string, strict bool, writer io.Writer) error

func WriteCBOR added in v0.1.20

func WriteCBOR(value any, writer io.Writer) error

func WriteCompatibleJSON added in v0.1.15

func WriteCompatibleJSON(value any, writer io.Writer, indent string) error

func WriteCompatibleXML added in v0.1.18

func WriteCompatibleXML(value any, writer io.Writer, indent string) error

func WriteGo added in v0.1.53

func WriteGo(value any, writer io.Writer, indent string) error

func WriteJSON

func WriteJSON(value any, writer io.Writer, indent string) error

func WriteOrPrint

func WriteOrPrint(value any, 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 any, 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