format

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: Apache-2.0 Imports: 15 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 Decode

func Decode(code string, format string, all bool) (ard.Value, error)

func DecodeAllYAML

func DecodeAllYAML(code string) (ard.List, error)

func DecodeCompatibleJSON added in v0.1.15

func DecodeCompatibleJSON(code string) (ard.Value, error)

func DecodeCompatibleXML added in v0.1.18

func DecodeCompatibleXML(code string) (ard.Value, error)

func DecodeJSON

func DecodeJSON(code string) (ard.Value, error)

func DecodeYAML

func DecodeYAML(code string) (ard.Value, error)

func DecodeYAMLTemplate

func DecodeYAMLTemplate(code string, data interface{}) (interface{}, error)

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(data interface{}, format string, strict bool) (string, error)

func EncodeCompatibleJSON added in v0.1.15

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

func EncodeCompatibleXML added in v0.1.18

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

func EncodeJSON

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

func EncodeYAML

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

func Normalize

func Normalize(data interface{}) (interface{}, error)

func OpenFileForWrite

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

func Print

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

func PrintCompatibleJSON added in v0.1.15

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

func PrintCompatibleXML added in v0.1.18

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

func PrintJSON

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

func PrintXMLDocument

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

func PrintYAML

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

func Read

func Read(reader io.Reader, format string) (ard.Value, error)

func ReadAllYAML

func ReadAllYAML(reader io.Reader) (ard.List, error)

func ReadCompatibleJSON added in v0.1.15

func ReadCompatibleJSON(reader io.Reader) (ard.Value, error)

func ReadCompatibleXML added in v0.1.18

func ReadCompatibleXML(reader io.Reader) (ard.Value, error)

func ReadJSON

func ReadJSON(reader io.Reader) (ard.Value, error)

func ReadYAML

func ReadYAML(reader io.Reader) (ard.Value, error)

func ToCompatibleJSON added in v0.1.15

func ToCompatibleJSON(value ard.Value) ard.Value

func Validate

func Validate(code string, format 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(data interface{}, format string, indent string, strict bool, writer io.Writer) error

func WriteCompatibleJSON added in v0.1.15

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

func WriteCompatibleXML added in v0.1.18

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

func WriteJSON

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

func WriteOrPrint

func WriteOrPrint(data 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(data 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