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


Golang TProtocol.WriteFieldEnd方法代碼示例

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


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

示例1: writeField0

func (p *BaseServiceGetInterfaceVersionsResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.MAP, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Success)); err != nil {
			return thrift.PrependError("error writing map begin: ", err)
		}
		for k, v := range p.Success {
			if err := oprot.WriteString(string(k)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
			if err := v.Write(oprot); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return thrift.PrependError("error writing map end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}
開發者ID:upfluence,項目名稱:goutils,代碼行數:25,代碼來源:baseservice.go

示例2: writeField0

func (p *MonitoringCollectResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.MAP, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.DOUBLE, len(p.Success)); err != nil {
			return thrift.PrependError("error writing map begin: ", err)
		}
		for k, v := range p.Success {
			if err := oprot.WriteString(string(k)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
			if err := oprot.WriteDouble(float64(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return thrift.PrependError("error writing map end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}
開發者ID:upfluence,項目名稱:goutils,代碼行數:25,代碼來源:monitoring.go

示例3: writeField2

func (p *GitVersion) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("remote", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:remote: ", p), err)
	}
	if err := oprot.WriteString(string(p.Remote)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.remote (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:remote: ", p), err)
	}
	return err
}
開發者ID:upfluence,項目名稱:goutils,代碼行數:12,代碼來源:ttypes.go

示例4: writeField3

func (p *GitVersion) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("branch", thrift.STRING, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:branch: ", p), err)
	}
	if err := oprot.WriteString(string(p.Branch)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.branch (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:branch: ", p), err)
	}
	return err
}
開發者ID:upfluence,項目名稱:goutils,代碼行數:12,代碼來源:ttypes.go

示例5: writeField1

func (p *GitVersion) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("commit", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:commit: ", p), err)
	}
	if err := oprot.WriteString(string(p.Commit)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.commit (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:commit: ", p), err)
	}
	return err
}
開發者ID:upfluence,項目名稱:goutils,代碼行數:12,代碼來源:ttypes.go

示例6: writeField2

func (p *MonitoringCollectResult) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetUnknownMetric() {
		if err := oprot.WriteFieldBegin("unknownMetric", thrift.STRUCT, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:unknownMetric: ", p), err)
		}
		if err := p.UnknownMetric.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UnknownMetric), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:unknownMetric: ", p), err)
		}
	}
	return err
}
開發者ID:upfluence,項目名稱:goutils,代碼行數:14,代碼來源:monitoring.go

示例7: writeField1

func (p *MonitoringCollectResult) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetServiceUnavailable() {
		if err := oprot.WriteFieldBegin("serviceUnavailable", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:serviceUnavailable: ", p), err)
		}
		if err := p.ServiceUnavailable.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ServiceUnavailable), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:serviceUnavailable: ", p), err)
		}
	}
	return err
}
開發者ID:upfluence,項目名稱:goutils,代碼行數:14,代碼來源:monitoring.go


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