本文整理汇总了Golang中git/apache/org/thrift/git/lib/go/thrift.TProtocol.WriteBinary方法的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol.WriteBinary方法的具体用法?Golang TProtocol.WriteBinary怎么用?Golang TProtocol.WriteBinary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类git/apache/org/thrift/git/lib/go/thrift.TProtocol
的用法示例。
在下文中一共展示了TProtocol.WriteBinary方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: writeField1
func (p *CalculatorRmqCallArgs) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("bin", thrift.STRING, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:bin: ", p), err)
}
if err := oprot.WriteBinary(p.Bin); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.bin (1) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:bin: ", p), err)
}
return err
}
示例2: writeField7
func (p *DadoTransporteThrift) writeField7(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("dadoSerializado", thrift.STRING, 7); err != nil {
return fmt.Errorf("%T write field begin error 7:dadoSerializado: %s", p, err)
}
if err := oprot.WriteBinary(p.DadoSerializado); err != nil {
return fmt.Errorf("%T.dadoSerializado (7) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 7:dadoSerializado: %s", p, err)
}
return err
}
示例3: writeField1
func (p *GenerateArgs) writeField1(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("img", thrift.STRING, 1); err != nil {
return fmt.Errorf("%T write field begin error 1:img: %s", p, err)
}
if err := oprot.WriteBinary(p.Img); err != nil {
return fmt.Errorf("%T.img (1) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 1:img: %s", p, err)
}
return err
}
示例4: writeField2
func (p *Blog) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("content", thrift.STRING, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:content: %s", p, err)
}
if err := oprot.WriteBinary(p.Content); err != nil {
return fmt.Errorf("%T.content (2) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 2:content: %s", p, err)
}
return err
}
示例5: writeField2
func (p *PutCommand) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("data", thrift.STRING, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:data: ", p), err)
}
if err := oprot.WriteBinary(p.Data); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.data (2) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:data: ", p), err)
}
return err
}
示例6: writeField2
func (p *ThriftFlumeEvent) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("body", thrift.STRING, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:body: %s", p, err)
}
if err := oprot.WriteBinary(p.Body); err != nil {
return fmt.Errorf("%T.body (2) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 2:body: %s", p, err)
}
return err
}
示例7: writeField2
func (p *BinaryAnnotation) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err)
}
if err := oprot.WriteBinary(p.Value); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err)
}
return err
}
示例8: writeField2
func (p *SetStateArgs) writeField2(oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil {
return fmt.Errorf("%T write field begin error 2:value: %s", p, err)
}
if err := oprot.WriteBinary(p.Value); err != nil {
return fmt.Errorf("%T.value (2) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 2:value: %s", p, err)
}
return err
}
示例9: writeField8
func (p *Entry) writeField8(oprot thrift.TProtocol) (err error) {
if p.IsSetWriterOutput() {
if err := oprot.WriteFieldBegin("writer_output", thrift.STRING, 8); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:writer_output: ", p), err)
}
if err := oprot.WriteBinary(p.WriterOutput); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.writer_output (8) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 8:writer_output: ", p), err)
}
}
return err
}
示例10: writeField3
func (p *EntryMessage) writeField3(oprot thrift.TProtocol) (err error) {
if p.IsSetValue() {
if err := oprot.WriteFieldBegin("value", thrift.STRING, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:value: ", p), err)
}
if err := oprot.WriteBinary(p.Value); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.value (3) field write error: ", p), err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:value: ", p), err)
}
}
return err
}
示例11: writeField0
func (p *FindByResult) writeField0(oprot thrift.TProtocol) (err error) {
if p.Success != nil {
if err := oprot.WriteFieldBegin("success", thrift.BINARY, 0); err != nil {
return fmt.Errorf("%T write field begin error 0:success: %s", p, err)
}
if err := oprot.WriteBinary(p.Success); err != nil {
return fmt.Errorf("%T.success (0) field write error: %s", p)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 0:success: %s", p, err)
}
}
return err
}
示例12: writeField1
func (p *FindByArgs) writeField1(oprot thrift.TProtocol) (err error) {
if p.Criteria != nil {
if err := oprot.WriteFieldBegin("criteria", thrift.BINARY, 1); err != nil {
return fmt.Errorf("%T write field begin error 1:criteria: %s", p, err)
}
if err := oprot.WriteBinary(p.Criteria); err != nil {
return fmt.Errorf("%T.criteria (1) field write error: %s", p)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 1:criteria: %s", p, err)
}
}
return err
}
示例13: writeField1
func (p *Item) writeField1(oprot thrift.TProtocol) (err error) {
if p.Data != nil {
if err := oprot.WriteFieldBegin("data", thrift.BINARY, 1); err != nil {
return fmt.Errorf("%T write field begin error 1:data: %s", p, err)
}
if err := oprot.WriteBinary(p.Data); err != nil {
return fmt.Errorf("%T.data (1) field write error: %s", p)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 1:data: %s", p, err)
}
}
return err
}
示例14: writeField3
func (p *InsertOrUpdateArgs) writeField3(oprot thrift.TProtocol) (err error) {
if p.Value != nil {
if err := oprot.WriteFieldBegin("value", thrift.BINARY, 3); err != nil {
return fmt.Errorf("%T write field begin error 3:value: %s", p, err)
}
if err := oprot.WriteBinary(p.Value); err != nil {
return fmt.Errorf("%T.value (3) field write error: %s", p)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 3:value: %s", p, err)
}
}
return err
}
示例15: writeField0
func (p *GetStateResult) writeField0(oprot thrift.TProtocol) (err error) {
if p.IsSetSuccess() {
if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil {
return fmt.Errorf("%T write field begin error 0:success: %s", p, err)
}
if err := oprot.WriteBinary(p.Success); err != nil {
return fmt.Errorf("%T.success (0) field write error: %s", p, err)
}
if err := oprot.WriteFieldEnd(); err != nil {
return fmt.Errorf("%T write field end error 0:success: %s", p, err)
}
}
return err
}