xml

package
Version: v0.0.0-...-f53fa8d Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SupplementalData

type SupplementalData struct {
	XMLName xml.Name `xml:"supplementalData"`
	Text    string   `xml:",chardata"`
	Version struct {
		Text   string `xml:",chardata"`
		Number string `xml:"number,attr"`
	} `xml:"version"`
	WindowsZones struct {
		Text         string `xml:",chardata"`
		MapTimezones struct {
			Text         string   `xml:",chardata"`
			OtherVersion string   `xml:"otherVersion,attr"`
			TypeVersion  string   `xml:"typeVersion,attr"`
			MapZone      mapZones `xml:"mapZone"`
		} `xml:"mapTimezones"`
	} `xml:"windowsZones"`
}

SupplementalData makes decoding the structure of the xml data found at https://github.com/unicode-org/cldr/blob/master/common/supplemental/windowsZones.xml a good deal easier with a couple of helpers for shits and giggles

func ReadSupplementalData

func ReadSupplementalData(r io.Reader) (supData SupplementalData, err error)

ReadSupplementalData takes the given reader which hopefully is pointed at a xml stream, parses that xml stream and returns a SupplimentalData object

func (SupplementalData) ToOlson

func (s SupplementalData) ToOlson(zoneName string) string

ToOlsen will return the "Default" Olsen type for a given Windows one

func (SupplementalData) ToWindows

func (s SupplementalData) ToWindows(zoneName string) string

ToWindows will give you the Windows zone name for a given Olsen one

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL