当前位置: 首页>>代码示例>>Golang>>正文


Golang TProtocol.WriteBinary方法代码示例

本文整理汇总了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
}
开发者ID:glycerine,项目名称:rmq,代码行数:12,代码来源:calculator.go

示例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
}
开发者ID:esusab,项目名称:integracao,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:faiq,项目名称:intro-to-rpc,代码行数:12,代码来源:maketags.go

示例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
}
开发者ID:amwicfai,项目名称:go-example,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:nipuntalukdar,项目名称:NipunTalukdarExamples,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:ceocoder,项目名称:glumelogger,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:elodina,项目名称:go-zipkin,代码行数:12,代码来源:ttypes.go

示例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
}
开发者ID:concord,项目名称:concord-go,代码行数:12,代码来源:mutableephemeralstateservice.go

示例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
}
开发者ID:peter-edge,项目名称:lion-go,代码行数:14,代码来源:ttypes.go

示例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
}
开发者ID:peter-edge,项目名称:lion-go,代码行数:14,代码来源:ttypes.go

示例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
}
开发者ID:mvpmvh,项目名称:DE2,代码行数:14,代码来源:binary_messenger.go

示例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
}
开发者ID:mvpmvh,项目名称:DE2,代码行数:14,代码来源:binary_messenger.go

示例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
}
开发者ID:houcy,项目名称:go-kestrel,代码行数:14,代码来源:ttypes.go

示例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
}
开发者ID:cosh,项目名称:C4,代码行数:14,代码来源:c4.go

示例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
}
开发者ID:concord,项目名称:concord-go,代码行数:14,代码来源:mutableephemeralstateservice.go


注:本文中的git/apache/org/thrift/git/lib/go/thrift.TProtocol.WriteBinary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。