当前位置: 首页>>代码示例>>Golang>>正文


Golang Unmarshaller.UnmarshalBool方法代码示例

本文整理汇总了Golang中github.com/calmh/xdr.Unmarshaller.UnmarshalBool方法的典型用法代码示例。如果您正苦于以下问题:Golang Unmarshaller.UnmarshalBool方法的具体用法?Golang Unmarshaller.UnmarshalBool怎么用?Golang Unmarshaller.UnmarshalBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/calmh/xdr.Unmarshaller的用法示例。


在下文中一共展示了Unmarshaller.UnmarshalBool方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: UnmarshalXDRFrom

func (o *SessionInvitation) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.From = u.UnmarshalBytesMax(32)
	o.Key = u.UnmarshalBytesMax(32)
	o.Address = u.UnmarshalBytesMax(32)
	o.Port = u.UnmarshalUint16()
	o.ServerSocket = u.UnmarshalBool()
	return u.Error
}
开发者ID:letiemble,项目名称:syncthing,代码行数:8,代码来源:packets_xdr.go

示例2: UnmarshalXDRFrom

func (o *XDRA) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Name = u.UnmarshalString()
	o.BirthDay = int64(u.UnmarshalUint64())
	o.Phone = u.UnmarshalString()
	o.Siblings = int32(u.UnmarshalUint32())
	o.Spouse = u.UnmarshalBool()
	o.Money = u.UnmarshalUint64()
	return u.Error
}
开发者ID:alecthomas,项目名称:go_serialization_benchmarks,代码行数:9,代码来源:structdefxdr_generated.go

示例3: UnmarshalXDRFrom

func (o *TestStruct) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.B = u.UnmarshalBool()
	o.I = int(u.UnmarshalUint64())
	o.I8 = int8(u.UnmarshalUint8())
	o.UI8 = u.UnmarshalUint8()
	o.I16 = int16(u.UnmarshalUint16())
	o.UI16 = u.UnmarshalUint16()
	o.I32 = int32(u.UnmarshalUint32())
	o.UI32 = u.UnmarshalUint32()
	o.I64 = int64(u.UnmarshalUint64())
	o.UI64 = u.UnmarshalUint64()
	o.BS = u.UnmarshalBytesMax(1024)
	o.S = u.UnmarshalStringMax(1024)
	(&o.C).UnmarshalXDRFrom(u)
	_SSSize := int(u.UnmarshalUint32())
	if _SSSize < 0 {
		return xdr.ElementSizeExceeded("SS", _SSSize, 1024)
	} else if _SSSize == 0 {
		o.SS = nil
	} else {
		if _SSSize > 1024 {
			return xdr.ElementSizeExceeded("SS", _SSSize, 1024)
		}
		if _SSSize <= len(o.SS) {
			for i := _SSSize; i < len(o.SS); i++ {
				o.SS[i] = ""
			}
			o.SS = o.SS[:_SSSize]
		} else {
			o.SS = make([]string, _SSSize)
		}
		for i := range o.SS {
			o.SS[i] = u.UnmarshalString()
		}
	}
	(&o.ES).UnmarshalXDRFrom(u)
	(&o.OS).UnmarshalXDRFrom(u)
	_OSsSize := int(u.UnmarshalUint32())
	if _OSsSize < 0 {
		return xdr.ElementSizeExceeded("OSs", _OSsSize, 0)
	} else if _OSsSize == 0 {
		o.OSs = nil
	} else {
		if _OSsSize <= len(o.OSs) {
			o.OSs = o.OSs[:_OSsSize]
		} else {
			o.OSs = make([]OtherStruct, _OSsSize)
		}
		for i := range o.OSs {
			(&o.OSs[i]).UnmarshalXDRFrom(u)
		}
	}
	return u.Error
}
开发者ID:letiemble,项目名称:syncthing,代码行数:54,代码来源:encdec_xdr_test.go


注:本文中的github.com/calmh/xdr.Unmarshaller.UnmarshalBool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。