當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。