From 629cb407c10743b0033fdc648a3c876f244cf558 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 26 Jan 2020 23:13:22 -0500 Subject: UnmarshalBinary, EOF --- rrdformat/marshal_xml.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 rrdformat/marshal_xml.go (limited to 'rrdformat/marshal_xml.go') diff --git a/rrdformat/marshal_xml.go b/rrdformat/marshal_xml.go new file mode 100644 index 0000000..dfb0556 --- /dev/null +++ b/rrdformat/marshal_xml.go @@ -0,0 +1,19 @@ +package rrdformat + +import ( + "encoding/xml" +) + +func (h *Header) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + if err := e.EncodeElement(h.Version, xml.StartElement{Name: xml.Name{Local: "version", Space: XMLNS}}); err != nil { + return err + } + if err := e.EncodeElement(h.PDPStep, xml.StartElement{Name: xml.Name{Local: "step", Space: XMLNS}}); err != nil { + return err + } + return nil +} + +var _ xml.Marshaler = &Header{} + +//var _ xml.Unmarshaler = &Header{} -- cgit v1.2.3-2-g168b