本文整理匯總了Golang中github.com/calmh/xdr.Marshaller類的典型用法代碼示例。如果您正苦於以下問題:Golang Marshaller類的具體用法?Golang Marshaller怎麽用?Golang Marshaller使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Marshaller類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: MarshalXDRInto
func (o Address) MarshalXDRInto(m *xdr.Marshaller) error {
if l := len(o.URL); l > 2083 {
return xdr.ElementSizeExceeded("URL", l, 2083)
}
m.MarshalString(o.URL)
return m.Error
}
示例2: MarshalXDRInto
func (o JoinSessionRequest) MarshalXDRInto(m *xdr.Marshaller) error {
if l := len(o.Key); l > 32 {
return xdr.ElementSizeExceeded("Key", l, 32)
}
m.MarshalBytes(o.Key)
return m.Error
}
示例3: MarshalXDRInto
func (o ClusterConfigMessage) MarshalXDRInto(m *xdr.Marshaller) error {
if l := len(o.DeviceName); l > 64 {
return xdr.ElementSizeExceeded("DeviceName", l, 64)
}
m.MarshalString(o.DeviceName)
if l := len(o.ClientName); l > 64 {
return xdr.ElementSizeExceeded("ClientName", l, 64)
}
m.MarshalString(o.ClientName)
if l := len(o.ClientVersion); l > 64 {
return xdr.ElementSizeExceeded("ClientVersion", l, 64)
}
m.MarshalString(o.ClientVersion)
if l := len(o.Folders); l > 1000000 {
return xdr.ElementSizeExceeded("Folders", l, 1000000)
}
m.MarshalUint32(uint32(len(o.Folders)))
for i := range o.Folders {
if err := o.Folders[i].MarshalXDRInto(m); err != nil {
return err
}
}
if l := len(o.Options); l > 64 {
return xdr.ElementSizeExceeded("Options", l, 64)
}
m.MarshalUint32(uint32(len(o.Options)))
for i := range o.Options {
if err := o.Options[i].MarshalXDRInto(m); err != nil {
return err
}
}
return m.Error
}
示例4: MarshalXDRInto
func (o fileVersion) MarshalXDRInto(m *xdr.Marshaller) error {
if err := o.version.MarshalXDRInto(m); err != nil {
return err
}
m.MarshalBytes(o.device)
return m.Error
}
示例5: MarshalXDRInto
func (o Folder) MarshalXDRInto(m *xdr.Marshaller) error {
if l := len(o.ID); l > 256 {
return xdr.ElementSizeExceeded("ID", l, 256)
}
m.MarshalString(o.ID)
if l := len(o.Label); l > 256 {
return xdr.ElementSizeExceeded("Label", l, 256)
}
m.MarshalString(o.Label)
if l := len(o.Devices); l > 1000000 {
return xdr.ElementSizeExceeded("Devices", l, 1000000)
}
m.MarshalUint32(uint32(len(o.Devices)))
for i := range o.Devices {
if err := o.Devices[i].MarshalXDRInto(m); err != nil {
return err
}
}
m.MarshalUint32(o.Flags)
if l := len(o.Options); l > 64 {
return xdr.ElementSizeExceeded("Options", l, 64)
}
m.MarshalUint32(uint32(len(o.Options)))
for i := range o.Options {
if err := o.Options[i].MarshalXDRInto(m); err != nil {
return err
}
}
return m.Error
}
示例6: MarshalXDRInto
func (o Device) MarshalXDRInto(m *xdr.Marshaller) error {
if l := len(o.ID); l > 32 {
return xdr.ElementSizeExceeded("ID", l, 32)
}
m.MarshalBytes(o.ID)
if l := len(o.Addresses); l > 16 {
return xdr.ElementSizeExceeded("Addresses", l, 16)
}
m.MarshalUint32(uint32(len(o.Addresses)))
for i := range o.Addresses {
if err := o.Addresses[i].MarshalXDRInto(m); err != nil {
return err
}
}
return m.Error
}
示例7: MarshalXDRInto
func (v Vector) MarshalXDRInto(m *xdr.Marshaller) error {
m.MarshalUint32(uint32(len(v)))
for i := range v {
m.MarshalUint64(uint64(v[i].ID))
m.MarshalUint64(v[i].Value)
}
return m.Error
}
示例8: MarshalXDRInto
func (o Version13HelloMessage) MarshalXDRInto(m *xdr.Marshaller) error {
if l := len(o.DeviceName); l > 64 {
return xdr.ElementSizeExceeded("DeviceName", l, 64)
}
m.MarshalString(o.DeviceName)
if l := len(o.ClientName); l > 64 {
return xdr.ElementSizeExceeded("ClientName", l, 64)
}
m.MarshalString(o.ClientName)
if l := len(o.ClientVersion); l > 64 {
return xdr.ElementSizeExceeded("ClientVersion", l, 64)
}
m.MarshalString(o.ClientVersion)
return m.Error
}
示例9: MarshalXDRInto
func (o OtherStruct) MarshalXDRInto(m *xdr.Marshaller) error {
m.MarshalUint32(o.F1)
m.MarshalString(o.F2)
return m.Error
}
示例10: MarshalXDRInto
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
}
示例11: MarshalXDRInto
func (h header) MarshalXDRInto(m *xdr.Marshaller) error {
v := encodeHeader(h)
m.MarshalUint32(v)
return m.Error
}
示例12: MarshalXDRInto
func (u *Opaque) MarshalXDRInto(m *xdr.Marshaller) error {
m.MarshalRaw(u[:])
return m.Error
}
示例13: MarshalXDRInto
func (o XDRBenchStruct) MarshalXDRInto(m *xdr.Marshaller) error {
m.MarshalUint64(o.I1)
m.MarshalUint32(o.I2)
m.MarshalUint16(o.I3)
m.MarshalUint8(o.I4)
if l := len(o.Bs0); l > 128 {
return xdr.ElementSizeExceeded("Bs0", l, 128)
}
m.MarshalBytes(o.Bs0)
m.MarshalBytes(o.Bs1)
m.MarshalUint32(uint32(len(o.Is0)))
for i := range o.Is0 {
m.MarshalUint32(uint32(o.Is0[i]))
}
if l := len(o.S0); l > 128 {
return xdr.ElementSizeExceeded("S0", l, 128)
}
m.MarshalString(o.S0)
m.MarshalString(o.S1)
return m.Error
}