本文整理汇总了Golang中github.com/bcgraham/tsumtsum/external/thrift.TProtocol类的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol类的具体用法?Golang TProtocol怎么用?Golang TProtocol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TProtocol类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Read
func (p *FindAndAddContactsByUseridArgs) 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
}
示例2: Read
func (p *GetLastReadMessageIdsResult) 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
}
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
}
示例3: writeField0
func (p *FindAndAddContactsByUseridResult) writeField0(oprot thrift.TProtocol) (err error) {
if p.IsSetSuccess() {
if err := oprot.WriteFieldBegin("success", thrift.MAP, 0); err != nil {
return fmt.Errorf("%T write field begin error 0:success: %s", p, err)
}
if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Success)); err != nil {
return fmt.Errorf("error writing map begin: %s", err)
}
for k, v := range p.Success {
if err := oprot.WriteString(string(k)); err != nil {
return fmt.Errorf("%T. (0) field write error: %s", p, err)
}
if err := v.Write(oprot); err != nil {
return fmt.Errorf("%T error writing struct: %s", v, err)
}
}
if err := oprot.WriteMapEnd(); err != nil {
return fmt.Errorf("error writing map end: %s", err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 0:success: %s", p, err)
}
}
return err
}
示例4: Read
func (p *LoginWithVerifierForCertificateArgs) 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 3:
if err := p.ReadField3(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
}
示例5: Read
func (p *GetMessageBoxCompactWrapUpListArgs) 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 2:
if err := p.ReadField2(iprot); err != nil {
return err
}
case 3:
if err := p.ReadField3(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
}
示例6: ReadField3
func (p *LoginWithVerifierForCertificateArgs) ReadField3(iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(); err != nil {
return fmt.Errorf("error reading field 3: %s", err)
} else {
p.Verifier = v
}
return nil
}
示例7: ReadField9
func (p *LoginWithIdentityCredentialForCertificateArgs) ReadField9(iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(); err != nil {
return fmt.Errorf("error reading field 9: %s", err)
} else {
p.Certificate = v
}
return nil
}
示例8: ReadField5
func (p *LoginWithIdentityCredentialForCertificateArgs) ReadField5(iprot thrift.TProtocol) error {
if v, err := iprot.ReadBool(); err != nil {
return fmt.Errorf("error reading field 5: %s", err)
} else {
p.KeepLoggedIn = v
}
return nil
}
示例9: ReadField0
func (p *GetLastOpRevisionResult) ReadField0(iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(); err != nil {
return fmt.Errorf("error reading field 0: %s", err)
} else {
p.Success = &v
}
return nil
}
示例10: ReadField4
func (p *FetchMessageOperationsArgs) ReadField4(iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(); err != nil {
return fmt.Errorf("error reading field 4: %s", err)
} else {
p.Count = v
}
return nil
}
示例11: ReadField1
func (p *FindAndAddContactsByMidArgs) ReadField1(iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(); err != nil {
return fmt.Errorf("error reading field 1: %s", err)
} else {
p.ReqSeq = v
}
return nil
}
示例12: ReadField2
func (p *GetLastReadMessageIdsArgs) ReadField2(iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(); err != nil {
return fmt.Errorf("error reading field 2: %s", err)
} else {
p.ChatId = v
}
return nil
}
示例13: ReadField3
func (p *FetchMessageOperationsArgs) ReadField3(iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(); err != nil {
return fmt.Errorf("error reading field 3: %s", err)
} else {
p.LastOpTimestamp = v
}
return nil
}
示例14: ReadField3
func (p *GetMessageBoxCompactWrapUpListArgs) ReadField3(iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(); err != nil {
return fmt.Errorf("error reading field 3: %s", err)
} else {
p.MessageBoxCount = v
}
return nil
}
示例15: ReadField2
func (p *FindAndAddContactsByUseridArgs) ReadField2(iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(); err != nil {
return fmt.Errorf("error reading field 2: %s", err)
} else {
p.Userid = v
}
return nil
}