當前位置: 首頁>>代碼示例>>Golang>>正文


Golang TProtocol.WriteI64方法代碼示例

本文整理匯總了Golang中github.com/apache/thrift/lib/go/thrift.TProtocol.WriteI64方法的典型用法代碼示例。如果您正苦於以下問題:Golang TProtocol.WriteI64方法的具體用法?Golang TProtocol.WriteI64怎麽用?Golang TProtocol.WriteI64使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/apache/thrift/lib/go/thrift.TProtocol的用法示例。


在下文中一共展示了TProtocol.WriteI64方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: writeField2

func (p *AddServiceSumArgs) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("b", thrift.I64, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:b: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.B)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.b (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:b: ", p), err)
	}
	return err
}
開發者ID:cnicolov,項目名稱:kit,代碼行數:12,代碼來源:addservice.go

示例2: writeField3

func (p *Chunk) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("offset", thrift.I64, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:offset: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.Offset)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.offset (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:offset: ", p), err)
	}
	return err
}
開發者ID:akaspin,項目名稱:bar,代碼行數:12,代碼來源:ttypes.go

示例3: writeField2

func (p *AddArgs) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("b", thrift.I64, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:b: %s", p, err)
	}
	if err := oprot.WriteI64(int64(p.B)); err != nil {
		return fmt.Errorf("%T.b (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:b: %s", p, err)
	}
	return err
}
開發者ID:EthanK28,項目名稱:kit,代碼行數:12,代碼來源:addservice.go

示例4: writeField2

func (p *Dependencies) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("end_time", thrift.I64, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:end_time: %s", p, err)
	}
	if err := oprot.WriteI64(int64(p.EndTime)); err != nil {
		return fmt.Errorf("%T.end_time (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:end_time: %s", p, err)
	}
	return err
}
開發者ID:cnicolov,項目名稱:kit,代碼行數:12,代碼來源:ttypes.go

示例5: writeField1

func (p *Moments) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("m0", thrift.I64, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:m0: %s", p, err)
	}
	if err := oprot.WriteI64(int64(p.M0)); err != nil {
		return fmt.Errorf("%T.m0 (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:m0: %s", p, err)
	}
	return err
}
開發者ID:cnicolov,項目名稱:kit,代碼行數:12,代碼來源:ttypes.go

示例6: writeField1

func (p *Span) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("trace_id", thrift.I64, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:trace_id: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.TraceID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.trace_id (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:trace_id: ", p), err)
	}
	return err
}
開發者ID:ZhuJingfa,項目名稱:go-platform,代碼行數:12,代碼來源:ttypes.go

示例7: writeField4

func (p *Span) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("id", thrift.I64, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:id: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.ID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.id (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:id: ", p), err)
	}
	return err
}
開發者ID:ZhuJingfa,項目名稱:go-platform,代碼行數:12,代碼來源:ttypes.go

示例8: writeField1

func (p *AddArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("a", thrift.I64, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:a: %s", p, err)
	}
	if err := oprot.WriteI64(int64(p.A)); err != nil {
		return fmt.Errorf("%T.a (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:a: %s", p, err)
	}
	return err
}
開發者ID:EthanK28,項目名稱:kit,代碼行數:12,代碼來源:addservice.go

示例9: writeField2

func (p *DataInfo) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("size", thrift.I64, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:size: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.Size)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.size (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:size: ", p), err)
	}
	return err
}
開發者ID:akaspin,項目名稱:bar,代碼行數:12,代碼來源:ttypes.go

示例10: writeField1

func (p *SumReply) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("value", thrift.I64, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.Value)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err)
	}
	return err
}
開發者ID:crezam,項目名稱:kit,代碼行數:12,代碼來源:ttypes.go

示例11: writeField4

func (p *Span) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("id", thrift.I64, 4); err != nil {
		return fmt.Errorf("%T write field begin error 4:id: %s", p, err)
	}
	if err := oprot.WriteI64(int64(p.Id)); err != nil {
		return fmt.Errorf("%T.id (4) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 4:id: %s", p, err)
	}
	return err
}
開發者ID:taion809,項目名稱:go-zipkin,代碼行數:12,代碼來源:ttypes.go

示例12: writeField1

func (p *Span) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("trace_id", thrift.I64, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:trace_id: %s", p, err)
	}
	if err := oprot.WriteI64(int64(p.TraceId)); err != nil {
		return fmt.Errorf("%T.trace_id (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:trace_id: %s", p, err)
	}
	return err
}
開發者ID:taion809,項目名稱:go-zipkin,代碼行數:12,代碼來源:ttypes.go

示例13: writeField11

func (p *Span) writeField11(oprot thrift.TProtocol) (err error) {
	if p.IsSetDuration() {
		if err := oprot.WriteFieldBegin("duration", thrift.I64, 11); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:duration: ", p), err)
		}
		if err := oprot.WriteI64(int64(*p.Duration)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.duration (11) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 11:duration: ", p), err)
		}
	}
	return err
}
開發者ID:ZhuJingfa,項目名稱:go-platform,代碼行數:14,代碼來源:ttypes.go

示例14: writeField10

func (p *Span) writeField10(oprot thrift.TProtocol) (err error) {
	if p.IsSetTimestamp() {
		if err := oprot.WriteFieldBegin("timestamp", thrift.I64, 10); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:timestamp: ", p), err)
		}
		if err := oprot.WriteI64(int64(*p.Timestamp)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.timestamp (10) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 10:timestamp: ", p), err)
		}
	}
	return err
}
開發者ID:ZhuJingfa,項目名稱:go-platform,代碼行數:14,代碼來源:ttypes.go

示例15: writeField5

func (p *Span) writeField5(oprot thrift.TProtocol) (err error) {
	if p.IsSetParentID() {
		if err := oprot.WriteFieldBegin("parent_id", thrift.I64, 5); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:parent_id: ", p), err)
		}
		if err := oprot.WriteI64(int64(*p.ParentID)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.parent_id (5) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 5:parent_id: ", p), err)
		}
	}
	return err
}
開發者ID:ZhuJingfa,項目名稱:go-platform,代碼行數:14,代碼來源:ttypes.go


注:本文中的github.com/apache/thrift/lib/go/thrift.TProtocol.WriteI64方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。