func (o XDRA) MarshalXDRInto(m *xdr.Marshaller) error {
	m.MarshalString(o.Name)
	m.MarshalUint64(uint64(o.BirthDay))
	m.MarshalString(o.Phone)
	m.MarshalUint32(uint32(o.Siblings))
	m.MarshalBool(o.Spouse)
	m.MarshalUint64(o.Money)
	return m.Error
}
Exemplo n.º 2
0
func (o SessionInvitation) MarshalXDRInto(m *xdr.Marshaller) error {
	if l := len(o.From); l > 32 {
		return xdr.ElementSizeExceeded("From", l, 32)
	}
	m.MarshalBytes(o.From)
	if l := len(o.Key); l > 32 {
		return xdr.ElementSizeExceeded("Key", l, 32)
	}
	m.MarshalBytes(o.Key)
	if l := len(o.Address); l > 32 {
		return xdr.ElementSizeExceeded("Address", l, 32)
	}
	m.MarshalBytes(o.Address)
	m.MarshalUint16(o.Port)
	m.MarshalBool(o.ServerSocket)
	return m.Error
}
Exemplo n.º 3
0
func (o TestStruct) MarshalXDRInto(m *xdr.Marshaller) error {
	m.MarshalBool(o.B)
	m.MarshalUint64(uint64(o.I))
	m.MarshalUint8(uint8(o.I8))
	m.MarshalUint8(o.UI8)
	m.MarshalUint16(uint16(o.I16))
	m.MarshalUint16(o.UI16)
	m.MarshalUint32(uint32(o.I32))
	m.MarshalUint32(o.UI32)
	m.MarshalUint64(uint64(o.I64))
	m.MarshalUint64(o.UI64)
	if l := len(o.BS); l > 1024 {
		return xdr.ElementSizeExceeded("BS", l, 1024)
	}
	m.MarshalBytes(o.BS)
	if l := len(o.S); l > 1024 {
		return xdr.ElementSizeExceeded("S", l, 1024)
	}
	m.MarshalString(o.S)
	if err := o.C.MarshalXDRInto(m); err != nil {
		return err
	}
	if l := len(o.SS); l > 1024 {
		return xdr.ElementSizeExceeded("SS", l, 1024)
	}
	m.MarshalUint32(uint32(len(o.SS)))
	for i := range o.SS {
		m.MarshalString(o.SS[i])
	}
	if err := o.ES.MarshalXDRInto(m); err != nil {
		return err
	}
	if err := o.OS.MarshalXDRInto(m); err != nil {
		return err
	}
	m.MarshalUint32(uint32(len(o.OSs)))
	for i := range o.OSs {
		if err := o.OSs[i].MarshalXDRInto(m); err != nil {
			return err
		}
	}
	return m.Error
}