本文整理匯總了Golang中github.com/apesternikov/thrift4go/lib/go/src/thrift.TProtocol.ReadMapEnd方法的典型用法代碼示例。如果您正苦於以下問題:Golang TProtocol.ReadMapEnd方法的具體用法?Golang TProtocol.ReadMapEnd怎麽用?Golang TProtocol.ReadMapEnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/apesternikov/thrift4go/lib/go/src/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.ReadMapEnd方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: readField6
func (p *Manymaps) readField6(iprot thrift.TProtocol) (err thrift.TProtocolException) {
_ktype70, _vtype71, _size69, err := iprot.ReadMapBegin()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "p.Binarstructymap", "", err)
}
_, _ = _ktype70, _vtype71
p.Binarstructymap = make(map[string]*Intstruct, _size69)
for i := 0; i < _size69; i++ {
v76, err77 := iprot.ReadString()
if err77 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_key74", "", err77)
}
_key74 := v76
_val75 := NewIntstruct()
err80 := _val75.Read(iprot)
if err80 != nil {
return thrift.NewTProtocolExceptionReadStruct("_val75intstruct", err80)
}
p.Binarstructymap[_key74] = _val75
}
err = iprot.ReadMapEnd()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "", "map", err)
}
return err
}
示例2: readField5
func (p *Manymaps) readField5(iprot thrift.TProtocol) (err thrift.TProtocolException) {
_ktype57, _vtype58, _size56, err := iprot.ReadMapBegin()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "p.Binarymap", "", err)
}
_, _ = _ktype57, _vtype58
p.Binarymap = make(map[string]string, _size56)
for i := 0; i < _size56; i++ {
v63, err64 := iprot.ReadString()
if err64 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_key61", "", err64)
}
_key61 := v63
v65, err66 := iprot.ReadString()
if err66 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_val62", "", err66)
}
_val62 := v65
p.Binarymap[_key61] = _val62
}
err = iprot.ReadMapEnd()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "", "map", err)
}
return err
}
示例3: readField4
func (p *Manymaps) readField4(iprot thrift.TProtocol) (err thrift.TProtocolException) {
_ktype44, _vtype45, _size43, err := iprot.ReadMapBegin()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "p.Stringmap", "", err)
}
_, _ = _ktype44, _vtype45
p.Stringmap = make(map[string]string, _size43)
for i := 0; i < _size43; i++ {
v50, err51 := iprot.ReadString()
if err51 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_key48", "", err51)
}
_key48 := v50
v52, err53 := iprot.ReadString()
if err53 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_val49", "", err53)
}
_val49 := v52
p.Stringmap[_key48] = _val49
}
err = iprot.ReadMapEnd()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "", "map", err)
}
return err
}
示例4: readField3
func (p *Manymaps) readField3(iprot thrift.TProtocol) (err thrift.TProtocolException) {
_ktype31, _vtype32, _size30, err := iprot.ReadMapBegin()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "p.I32map", "", err)
}
_, _ = _ktype31, _vtype32
p.I32map = make(map[int32]string, _size30)
for i := 0; i < _size30; i++ {
v37, err38 := iprot.ReadI32()
if err38 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_key35", "", err38)
}
_key35 := v37
v39, err40 := iprot.ReadString()
if err40 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_val36", "", err40)
}
_val36 := v39
p.I32map[_key35] = _val36
}
err = iprot.ReadMapEnd()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "", "map", err)
}
return err
}
示例5: readField2
func (p *Manymaps) readField2(iprot thrift.TProtocol) (err thrift.TProtocolException) {
_ktype18, _vtype19, _size17, err := iprot.ReadMapBegin()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "p.I16map", "", err)
}
_, _ = _ktype18, _vtype19
p.I16map = make(map[int16]string, _size17)
for i := 0; i < _size17; i++ {
v24, err25 := iprot.ReadI16()
if err25 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_key22", "", err25)
}
_key22 := v24
v26, err27 := iprot.ReadString()
if err27 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_val23", "", err27)
}
_val23 := v26
p.I16map[_key22] = _val23
}
err = iprot.ReadMapEnd()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "", "map", err)
}
return err
}
示例6: readField1
func (p *Manymaps) readField1(iprot thrift.TProtocol) (err thrift.TProtocolException) {
_ktype5, _vtype6, _size4, err := iprot.ReadMapBegin()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "p.Bytemap", "", err)
}
_, _ = _ktype5, _vtype6
p.Bytemap = make(map[int8]string, _size4)
for i := 0; i < _size4; i++ {
v11, err12 := iprot.ReadByte()
if err12 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_key9", "", err12)
}
_key9 := v11
v13, err14 := iprot.ReadString()
if err14 != nil {
return thrift.NewTProtocolExceptionReadField(0, "_val10", "", err14)
}
_val10 := v13
p.Bytemap[_key9] = _val10
}
err = iprot.ReadMapEnd()
if err != nil {
return thrift.NewTProtocolExceptionReadField(-1, "", "map", err)
}
return err
}