當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Marshaller.MarshalUint64方法代碼示例

本文整理匯總了Golang中github.com/calmh/xdr.Marshaller.MarshalUint64方法的典型用法代碼示例。如果您正苦於以下問題:Golang Marshaller.MarshalUint64方法的具體用法?Golang Marshaller.MarshalUint64怎麽用?Golang Marshaller.MarshalUint64使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/calmh/xdr.Marshaller的用法示例。


在下文中一共展示了Marshaller.MarshalUint64方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: MarshalXDRInto

func (o RequestMessage) MarshalXDRInto(m *xdr.Marshaller) error {
	if l := len(o.Folder); l > 256 {
		return xdr.ElementSizeExceeded("Folder", l, 256)
	}
	m.MarshalString(o.Folder)
	if l := len(o.Name); l > 8192 {
		return xdr.ElementSizeExceeded("Name", l, 8192)
	}
	m.MarshalString(o.Name)
	m.MarshalUint64(uint64(o.Offset))
	m.MarshalUint32(uint32(o.Size))
	if l := len(o.Hash); l > 64 {
		return xdr.ElementSizeExceeded("Hash", l, 64)
	}
	m.MarshalBytes(o.Hash)
	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
}
開發者ID:carriercomm,項目名稱:syncthing,代碼行數:27,代碼來源:message_xdr.go

示例2: 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
}
開發者ID:tcrutt,項目名稱:syncthing,代碼行數:8,代碼來源:vector_xdr.go

示例3: 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
}
開發者ID:alecthomas,項目名稱:go_serialization_benchmarks,代碼行數:9,代碼來源:structdefxdr_generated.go

示例4: 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
}
開發者ID:letiemble,項目名稱:syncthing,代碼行數:21,代碼來源:bench_xdr_test.go

示例5: MarshalXDRInto

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
}
開發者ID:letiemble,項目名稱:syncthing,代碼行數:43,代碼來源:encdec_xdr_test.go


注:本文中的github.com/calmh/xdr.Marshaller.MarshalUint64方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。