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


Golang Reader.Error方法代碼示例

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


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

示例1: decodeXDR

func (o *RequestMessage) decodeXDR(xr *xdr.Reader) error {
	o.Repository = xr.ReadStringMax(64)
	o.Name = xr.ReadStringMax(1024)
	o.Offset = xr.ReadUint64()
	o.Size = xr.ReadUint32()
	return xr.Error()
}
開發者ID:jjoergensen,項目名稱:syncthing,代碼行數:7,代碼來源:message_xdr.go

示例2: decodeXDR

func (o *AnnounceV1) decodeXDR(xr *xdr.Reader) error {
	o.Magic = xr.ReadUint32()
	o.Port = xr.ReadUint16()
	o.NodeID = xr.ReadStringMax(64)
	o.IP = xr.ReadBytesMax(16)
	return xr.Error()
}
開發者ID:ngpestelos,項目名稱:syncthing,代碼行數:7,代碼來源:packets_xdr.go

示例3: decodeXDR

func (o *versionList) decodeXDR(xr *xdr.Reader) error {
	_versionsSize := int(xr.ReadUint32())
	o.versions = make([]fileVersion, _versionsSize)
	for i := range o.versions {
		(&o.versions[i]).decodeXDR(xr)
	}
	return xr.Error()
}
開發者ID:jjoergensen,項目名稱:syncthing,代碼行數:8,代碼來源:leveldb_xdr.go

示例4: decodeXDR

func (o *IndexMessage) decodeXDR(xr *xdr.Reader) error {
	o.Repository = xr.ReadStringMax(64)
	_FilesSize := int(xr.ReadUint32())
	o.Files = make([]FileInfo, _FilesSize)
	for i := range o.Files {
		(&o.Files[i]).decodeXDR(xr)
	}
	return xr.Error()
}
開發者ID:retgoat,項目名稱:syncthing,代碼行數:9,代碼來源:message_xdr.go

示例5: decodeXDR

func (o *XDRBenchStruct) decodeXDR(xr *xdr.Reader) error {
	o.I1 = xr.ReadUint64()
	o.I2 = xr.ReadUint32()
	o.I3 = xr.ReadUint16()
	o.Bs0 = xr.ReadBytesMax(128)
	o.Bs1 = xr.ReadBytes()
	o.S0 = xr.ReadStringMax(128)
	o.S1 = xr.ReadString()
	return xr.Error()
}
開發者ID:BenKoerber,項目名稱:syncthing,代碼行數:10,代碼來源:bench_xdr_test.go

示例6: decodeXDR

func (o *OptionsMessage) decodeXDR(xr *xdr.Reader) error {
	_OptionsSize := int(xr.ReadUint32())
	if _OptionsSize > 64 {
		return xdr.ErrElementSizeExceeded
	}
	o.Options = make([]Option, _OptionsSize)
	for i := range o.Options {
		(&o.Options[i]).decodeXDR(xr)
	}
	return xr.Error()
}
開發者ID:ngpestelos,項目名稱:syncthing,代碼行數:11,代碼來源:message_xdr.go

示例7: decodeXDR

func (o *TestStruct) decodeXDR(xr *xdr.Reader) error {
	o.I = int(xr.ReadUint64())
	o.I16 = int16(xr.ReadUint16())
	o.UI16 = xr.ReadUint16()
	o.I32 = int32(xr.ReadUint32())
	o.UI32 = xr.ReadUint32()
	o.I64 = int64(xr.ReadUint64())
	o.UI64 = xr.ReadUint64()
	o.BS = xr.ReadBytes()
	o.S = xr.ReadString()
	return xr.Error()
}
開發者ID:KayoticSully,項目名稱:syncthing,代碼行數:12,代碼來源:encdec_xdr_test.go

示例8: decodeXDR

func (o *Node) decodeXDR(xr *xdr.Reader) error {
	o.ID = xr.ReadStringMax(64)
	_AddressesSize := int(xr.ReadUint32())
	if _AddressesSize > 16 {
		return xdr.ErrElementSizeExceeded
	}
	o.Addresses = make([]Address, _AddressesSize)
	for i := range o.Addresses {
		(&o.Addresses[i]).decodeXDR(xr)
	}
	return xr.Error()
}
開發者ID:BillTheBest,項目名稱:syncthing,代碼行數:12,代碼來源:packets_xdr.go

示例9: decodeXDR

func (o *File) decodeXDR(xr *xdr.Reader) error {
	o.Name = xr.ReadString()
	o.Flags = xr.ReadUint32()
	o.Modified = int64(xr.ReadUint64())
	o.Version = xr.ReadUint64()
	o.Size = int64(xr.ReadUint64())
	_BlocksSize := int(xr.ReadUint32())
	o.Blocks = make([]Block, _BlocksSize)
	for i := range o.Blocks {
		(&o.Blocks[i]).decodeXDR(xr)
	}
	o.Suppressed = xr.ReadBool()
	return xr.Error()
}
開發者ID:jjoergensen,項目名稱:syncthing,代碼行數:14,代碼來源:file_xdr.go

示例10: decodeXDR

func (h *header) decodeXDR(xr *xdr.Reader) error {
	u := xr.ReadUint32()
	*h = decodeHeader(u)
	return xr.Error()
}
開發者ID:retgoat,項目名稱:syncthing,代碼行數:5,代碼來源:header.go

示例11: decodeXDR

func (o *QueryV2) decodeXDR(xr *xdr.Reader) error {
	o.Magic = xr.ReadUint32()
	o.NodeID = xr.ReadStringMax(64)
	return xr.Error()
}
開發者ID:nbrownus,項目名稱:syncthing,代碼行數:5,代碼來源:packets_xdr.go

示例12: decodeXDR

func (o *QueryV2) decodeXDR(xr *xdr.Reader) error {
	o.Magic = xr.ReadUint32()
	o.NodeID = xr.ReadBytesMax(32)
	return xr.Error()
}
開發者ID:jjoergensen,項目名稱:syncthing,代碼行數:5,代碼來源:packets_xdr.go

示例13: decodeXDR

func (o *Block) decodeXDR(xr *xdr.Reader) error {
	o.Offset = int64(xr.ReadUint64())
	o.Size = xr.ReadUint32()
	o.Hash = xr.ReadBytes()
	return xr.Error()
}
開發者ID:jjoergensen,項目名稱:syncthing,代碼行數:6,代碼來源:blocks_xdr.go

示例14: decodeXDR

func (o *Node) decodeXDR(xr *xdr.Reader) error {
	o.ID = xr.ReadStringMax(64)
	o.Flags = xr.ReadUint32()
	return xr.Error()
}
開發者ID:nbrownus,項目名稱:syncthing,代碼行數:5,代碼來源:message_xdr.go


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