本文整理汇总了Golang中git/apache/org/thrift/git/lib/go/thrift.TProtocol类的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol类的具体用法?Golang TProtocol怎么用?Golang TProtocol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TProtocol类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Read
func (p *ProfissionalCboRowItemThrift) Read(iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(); err != nil {
return fmt.Errorf("%T read error: %s", p, err)
}
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
if err != nil {
return fmt.Errorf("%T field %d read error: %s", p, fieldId, err)
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 1:
if err := p.ReadField1(iprot); err != nil {
return err
}
case 2:
if err := p.ReadField2(iprot); err != nil {
return err
}
default:
if err := iprot.Skip(fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(); err != nil {
return fmt.Errorf("%T read struct end error: %s", p, err)
}
return nil
}
开发者ID:esusab,项目名称:integracao,代码行数:35,代码来源:ttypes.go
示例2: Read
func (p *InvalidRequestException) Read(iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(); err != nil {
return fmt.Errorf("%T read error", p)
}
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
if err != nil {
return fmt.Errorf("%T field %d read error: %s", p, fieldId, err)
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 1:
if err := p.readField1(iprot); err != nil {
return err
}
default:
if err := iprot.Skip(fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(); err != nil {
return fmt.Errorf("%T read struct end error: %s", p, err)
}
return nil
}
开发者ID:cosh,项目名称:C4,代码行数:31,代码来源:ttypes.go
示例3: writeField2
func (p *Result) writeField2(oprot thrift.TProtocol) (err error) {
if p.Palette != nil {
if err := oprot.WriteFieldBegin("palette", thrift.MAP, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:palette: %s", p, err)
}
if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Palette)); err != nil {
return fmt.Errorf("error writing map begin: %s")
}
for k, v := range p.Palette {
if err := oprot.WriteString(string(k)); err != nil {
return fmt.Errorf("%T. (0) field write error: %s", p)
}
if err := v.Write(oprot); err != nil {
return fmt.Errorf("%T error writing struct: %s", v)
}
}
if err := oprot.WriteMapEnd(); err != nil {
return fmt.Errorf("error writing map end: %s")
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 2:palette: %s", p, err)
}
}
return err
}
开发者ID:improvemedia,项目名称:colorcandy,代码行数:25,代码来源:ttypes.go
示例4: Read
func (p *SharedServiceGetStructResult) Read(iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
if err != nil {
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 0:
if err := p.readField0(iprot); err != nil {
return err
}
default:
if err := iprot.Skip(fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
return nil
}
开发者ID:glycerine,项目名称:golang-thrift-minimal-example,代码行数:32,代码来源:sharedservice.go
示例5: Read
func (p *TerminalServicePushPendingRequestFormArgs) Read(iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
if err != nil {
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 1:
if err := p.readField1(iprot); err != nil {
return err
}
default:
if err := iprot.Skip(fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
return nil
}
开发者ID:huodon,项目名称:tyful,代码行数:32,代码来源:terminalservice.go
示例6: Read
func (p *CreateResult) Read(iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(); err != nil {
return fmt.Errorf("%T read error: %s", p, err)
}
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
if err != nil {
return fmt.Errorf("%T field %d read error: %s", p, fieldId, err)
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 0:
if err := p.ReadField0(iprot); err != nil {
return err
}
default:
if err := iprot.Skip(fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(); err != nil {
return fmt.Errorf("%T read struct end error: %s", p, err)
}
return nil
}
开发者ID:ianrtracey,项目名称:go-thrift,代码行数:31,代码来源:contactsvc.go
示例7: Read
func (p *ImageSvcGetThumbnailByImageIdArgs) Read(iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
if err != nil {
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 1:
if err := p.ReadField1(iprot); err != nil {
return err
}
default:
if err := iprot.Skip(fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
return nil
}
开发者ID:sebsofen,项目名称:sportapp-server,代码行数:32,代码来源:imagesvc.go
示例8: Read
func (p *GetLockResult) Read(iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
if err != nil {
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
}
if fieldTypeId == thrift.STOP {
break
}
if err := iprot.Skip(fieldTypeId); err != nil {
return err
}
if err := iprot.ReadFieldEnd(); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
return nil
}
开发者ID:wallacexinyu,项目名称:Distributed-Productivity-Calendar,代码行数:25,代码来源:myservice.go
示例9: Read
func (p *Entry) Read(iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
if err != nil {
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 1:
if err := p.readField1(iprot); err != nil {
return err
}
case 2:
if err := p.readField2(iprot); err != nil {
return err
}
case 3:
if err := p.readField3(iprot); err != nil {
return err
}
case 4:
if err := p.readField4(iprot); err != nil {
return err
}
case 5:
if err := p.readField5(iprot); err != nil {
return err
}
case 6:
if err := p.readField6(iprot); err != nil {
return err
}
case 7:
if err := p.readField7(iprot); err != nil {
return err
}
case 8:
if err := p.readField8(iprot); err != nil {
return err
}
default:
if err := iprot.Skip(fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
return nil
}
开发者ID:peter-edge,项目名称:lion-go,代码行数:60,代码来源:ttypes.go
示例10: Read
func (p *DadoInstalacaoThrift) Read(iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(); err != nil {
return fmt.Errorf("%T read error: %s", p, err)
}
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
if err != nil {
return fmt.Errorf("%T field %d read error: %s", p, fieldId, err)
}
if fieldTypeId == thrift.STOP {
break
}
switch fieldId {
case 1:
if err := p.ReadField1(iprot); err != nil {
return err
}
case 2:
if err := p.ReadField2(iprot); err != nil {
return err
}
case 3:
if err := p.ReadField3(iprot); err != nil {
return err
}
case 4:
if err := p.ReadField4(iprot); err != nil {
return err
}
case 5:
if err := p.ReadField5(iprot); err != nil {
return err
}
case 6:
if err := p.ReadField6(iprot); err != nil {
return err
}
case 7:
if err := p.ReadField7(iprot); err != nil {
return err
}
case 8:
if err := p.ReadField8(iprot); err != nil {
return err
}
default:
if err := iprot.Skip(fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(); err != nil {
return fmt.Errorf("%T read struct end error: %s", p, err)
}
return nil
}
开发者ID:esusab,项目名称:integracao,代码行数:59,代码来源:ttypes.go
示例11: ReadField5
func (p *GetPrivateMessageListArgs) ReadField5(iprot thrift.TProtocol) error {
if v, err := iprot.ReadBool(); err != nil {
return fmt.Errorf("error reading field 5: %s", err)
} else {
p.IsReversed = v
}
return nil
}
开发者ID:lei-yu,项目名称:GOPATH,代码行数:8,代码来源:privatemessagemanagersync.go
示例12: ReadField3
func (p *SendShortMsgArgs) ReadField3(iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(); err != nil {
return fmt.Errorf("error reading field 3: %s", err)
} else {
p.Zone = v
}
return nil
}
开发者ID:lei-yu,项目名称:GOPATH,代码行数:8,代码来源:smsmanager.go
示例13: ReadField1
func (p *DestroyArgs) ReadField1(iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(); err != nil {
return fmt.Errorf("error reading field 1: %s", err)
} else {
p.ContactId = v
}
return nil
}
开发者ID:ianrtracey,项目名称:go-thrift,代码行数:8,代码来源:contactsvc.go
示例14: readField0
func (p *RpcServiceAddResult) readField0(iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
p.Success = &v
}
return nil
}
开发者ID:playnb,项目名称:grasslands,代码行数:8,代码来源:rpcservice.go
示例15: ReadField1
func (p *UpdateStatusArgs) ReadField1(iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(); err != nil {
return fmt.Errorf("error reading field 1: %s", err)
} else {
p.Key = v
}
return nil
}
开发者ID:lei-yu,项目名称:GOPATH,代码行数:8,代码来源:statusmanagersync.go
示例16: readField1
func (p *SharedServiceGetStructArgs) readField1(iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.Key = v
}
return nil
}
开发者ID:glycerine,项目名称:golang-thrift-minimal-example,代码行数:8,代码来源:sharedservice.go
示例17: readField2
func (p *InvalidOperation) readField2(iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.Why = v
}
return nil
}
开发者ID:sktzwhj,项目名称:thrift-0.9.3,代码行数:8,代码来源:ttypes.go
示例18: ReadField6
func (p *GetPrivateMessageListArgs) ReadField6(iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(); err != nil {
return fmt.Errorf("error reading field 6: %s", err)
} else {
p.RowCount = v
}
return nil
}
开发者ID:lei-yu,项目名称:GOPATH,代码行数:8,代码来源:privatemessagemanagersync.go
示例19: ReadField1
func (p *RpcException) ReadField1(iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.Code = v
}
return nil
}
开发者ID:jinhy,项目名称:rpc_proxy,代码行数:8,代码来源:ttypes.go
示例20: readField1
func (p *Work) readField1(iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.Num1 = v
}
return nil
}
开发者ID:sktzwhj,项目名称:thrift-0.9.3,代码行数:8,代码来源:ttypes.go
注:本文中的git/apache/org/thrift/git/lib/go/thrift.TProtocol类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论