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


Golang TProtocol.WriteFieldEnd方法代码示例

本文整理汇总了Golang中github.com/apache/thrift/lib/go/thrift.TProtocol.WriteFieldEnd方法的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol.WriteFieldEnd方法的具体用法?Golang TProtocol.WriteFieldEnd怎么用?Golang TProtocol.WriteFieldEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/apache/thrift/lib/go/thrift.TProtocol的用法示例。


在下文中一共展示了TProtocol.WriteFieldEnd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: 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

示例2: writeField3

func (p *VersionInfo) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("version", thrift.STRING, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err)
	}
	if err := oprot.WriteString(string(p.Version)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err)
	}
	return err
}
开发者ID:gosuper,项目名称:tchannel-go,代码行数:12,代码来源:ttypes.go

示例3: writeField1

func (p *HealthCheckRes) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("healthy", thrift.BOOL, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:healthy: %s", p, err)
	}
	if err := oprot.WriteBool(bool(p.Healthy)); err != nil {
		return fmt.Errorf("%T.healthy (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:healthy: %s", p, err)
	}
	return err
}
开发者ID:pengzhai,项目名称:tchannel,代码行数:12,代码来源:ttypes.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: writeField2

func (p *ThriftIDLs) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("entryPoint", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:entryPoint: ", p), err)
	}
	if err := oprot.WriteString(string(p.EntryPoint)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.entryPoint (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:entryPoint: ", p), err)
	}
	return err
}
开发者ID:gosuper,项目名称:tchannel-go,代码行数:12,代码来源:ttypes.go

示例6: writeField1

func (p *DependencyLink) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("parent", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:parent: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Parent)); err != nil {
		return fmt.Errorf("%T.parent (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:parent: %s", p, err)
	}
	return err
}
开发者ID:cnicolov,项目名称:kit,代码行数:12,代码来源:ttypes.go

示例7: writeField3

func (p *DependencyLink) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("duration_moments", thrift.STRUCT, 3); err != nil {
		return fmt.Errorf("%T write field begin error 3:duration_moments: %s", p, err)
	}
	if err := p.DurationMoments.Write(oprot); err != nil {
		return fmt.Errorf("%T error writing struct: %s", p.DurationMoments, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 3:duration_moments: %s", p, err)
	}
	return err
}
开发者ID:cnicolov,项目名称:kit,代码行数:12,代码来源:ttypes.go

示例8: 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:ZhuJingfa,项目名称:go-platform,代码行数:12,代码来源:ttypes.go

示例9: writeField3

func (p *BinaryAnnotation) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("annotation_type", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:annotation_type: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AnnotationType)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.annotation_type (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:annotation_type: ", p), err)
	}
	return err
}
开发者ID:ZhuJingfa,项目名称:go-platform,代码行数:12,代码来源:ttypes.go

示例10: 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

示例11: writeField4

func (p *Moments) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("m3", thrift.DOUBLE, 4); err != nil {
		return fmt.Errorf("%T write field begin error 4:m3: %s", p, err)
	}
	if err := oprot.WriteDouble(float64(p.M3)); err != nil {
		return fmt.Errorf("%T.m3 (4) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 4:m3: %s", p, err)
	}
	return err
}
开发者ID:cnicolov,项目名称:kit,代码行数:12,代码来源:ttypes.go

示例12: writeField1

func (p *LogEntry) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("category", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:category: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Category)); err != nil {
		return fmt.Errorf("%T.category (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:category: %s", p, err)
	}
	return err
}
开发者ID:adriancole,项目名称:go-zipkin,代码行数:12,代码来源:ttypes.go

示例13: writeField5

func (p *Moments) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("m4", thrift.DOUBLE, 5); err != nil {
		return fmt.Errorf("%T write field begin error 5:m4: %s", p, err)
	}
	if err := oprot.WriteDouble(float64(p.M4)); err != nil {
		return fmt.Errorf("%T.m4 (5) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 5:m4: %s", p, err)
	}
	return err
}
开发者ID:cnicolov,项目名称:kit,代码行数:12,代码来源:ttypes.go

示例14: writeField2

func (p *LogEntry) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("message", thrift.STRING, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:message: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Message)); err != nil {
		return fmt.Errorf("%T.message (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:message: %s", p, err)
	}
	return err
}
开发者ID:adriancole,项目名称:go-zipkin,代码行数:12,代码来源:ttypes.go

示例15: writeField1

func (p *KeyNotFound) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err)
	}
	if err := oprot.WriteString(string(p.Key)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err)
	}
	return err
}
开发者ID:gosuper,项目名称:tchannel-go,代码行数:12,代码来源:ttypes.go


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