Help us shape the future of Go! Take the 2026 Go Developer Survey

encoding

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: BSD-3-Clause, MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToJSON

func ToJSON(sn schema.Node, node datanode.DataNode) []byte

func ToRFC7951

func ToRFC7951(sn schema.Node, node datanode.DataNode) []byte

func ToXML

func ToXML(sn schema.Node, node datanode.DataNode) []byte

func UnmarshalJSON

func UnmarshalJSON(sn schema.Node, json_input []byte) (datanode.DataNode, error)

func UnmarshalJSONWithoutValidation

func UnmarshalJSONWithoutValidation(
	sn schema.Node,
	cfgOrState ConfigOrState,
	json_input []byte,
) (datanode.DataNode, error)

func UnmarshalRFC7951

func UnmarshalRFC7951(sn schema.Node, json_input []byte) (datanode.DataNode, error)

func UnmarshalRFC7951WithoutValidation

func UnmarshalRFC7951WithoutValidation(sn schema.Node, json_input []byte) (datanode.DataNode, error)

func UnmarshalXML

func UnmarshalXML(sn schema.Node, xml_input []byte) (datanode.DataNode, error)

Types

type ConfigOrState

type ConfigOrState bool
const (
	Config ConfigOrState = true
	State                = false
)

type EncType

type EncType int
const (
	JSON EncType = iota
	RFC7951
	XML
)

type JSONReader

type JSONReader struct {
	// contains filtered or unexported fields
}

type JSONWriter

type JSONWriter struct {
	bytes.Buffer
	// contains filtered or unexported fields
}

func (*JSONWriter) CurrentModuleName

func (jw *JSONWriter) CurrentModuleName() string

func (*JSONWriter) PopName

func (jw *JSONWriter) PopName()

func (*JSONWriter) PushName

func (jw *JSONWriter) PushName(sn schema.Node) string

type Unmarshaller

type Unmarshaller interface {
	SetValidation(schema.ValidationType) Unmarshaller
	Unmarshal(sn schema.Node, input []byte) (datanode.DataNode, error)
}

func NewUnmarshaller

func NewUnmarshaller(enc EncType) Unmarshaller

Jump to

Keyboard shortcuts

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