6
"github.com/juju/govmomi/vim25/xml"
9
type Values map[string][]string
11
type Response struct {
12
Info *CommandInfoMethod
16
func (v Values) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
26
if s, ok := t.(xml.StartElement); ok {
34
if c, ok := t.(xml.CharData); ok {
37
v[key] = append(v[key], val)
42
func (r *Response) Type(start xml.StartElement) string {
43
for _, a := range start.Attr {
44
if a.Name.Local == "type" {
51
func (r *Response) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
52
stype := r.Type(start)
54
if stype != "ArrayOfDataObject" {
56
if err := d.DecodeElement(&v, &start); err != nil {
59
r.Values = append(r.Values, v)
72
if s, ok := t.(xml.StartElement); ok {
73
if s.Name.Local == "DataObject" {
75
if err := d.DecodeElement(&v, &s); err != nil {
78
r.Values = append(r.Values, v)