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