xml

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package xml wraps encoding/xml as a codec.Codec implementation registered under Format("xml"). Blank-importing this package is enough to make XML resolvable via the core/codec registry.

Package xml — range 0.3.3.* (ADR 0005 service/codec/xml block).

Package xml — adapts *encoding/xml.Decoder to codec.Decoder.

Package xml — adapts *encoding/xml.Encoder to codec.Encoder.

Package xml — declares the sentinel *errs.Error values for XML.

Index

Constants

View Source
const CodeXMLMarshalFailed errs.Code = 0x00_03_03_01 // 0.3.3.1

CodeXMLMarshalFailed identifies a failure inside encoding/xml.Marshal.

View Source
const CodeXMLUnmarshalFailed errs.Code = 0x00_03_03_02 // 0.3.3.2

CodeXMLUnmarshalFailed identifies a failure inside encoding/xml.Unmarshal.

Variables

View Source
var (
	// MarshalFailed wraps a failure from encoding/xml.Marshal.
	MarshalFailed = errs.Define(CodeXMLMarshalFailed, "MARSHAL_FAILED",
		"XML encoding failed",
		"service/codec/xml: encoding/xml.Marshal returned an error")

	// UnmarshalFailed wraps a failure from encoding/xml.Unmarshal.
	UnmarshalFailed = errs.Define(CodeXMLUnmarshalFailed, "UNMARSHAL_FAILED",
		"XML decoding failed",
		"service/codec/xml: encoding/xml.Unmarshal returned an error")
)
View Source
var (
	//: register the singleton and expose it as a typed package var.
	Codec codec.Codec = codec.Register(&xmlCodec{})
)

Package-level state: the codec singleton plus the hoisted MIME / extension tables.

Functions

func New

func New() codec.Codec

New returns an XML codec instance.

Types

This section is empty.

Jump to

Keyboard shortcuts

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