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


Golang TProtocol.WriteI32方法代碼示例

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


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

示例1: writeField1

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

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

示例3: writeField2

func (p *ServicePeer) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("port", thrift.I32, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Port)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.port (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:port: ", p), err)
	}
	return err
}
開發者ID:gosuper,項目名稱:tchannel-go,代碼行數:12,代碼來源:ttypes.go

示例4: writeField3

func (p *Data) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("i3", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i3: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.I3)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.i3 (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i3: ", p), err)
	}
	return err
}
開發者ID:uber,項目名稱:tchannel-go,代碼行數:12,代碼來源:ttypes.go

示例5: writeField4

func (p *ServerInfo) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("maxConn", thrift.I32, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:maxConn: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.MaxConn)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.maxConn (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:maxConn: ", p), err)
	}
	return err
}
開發者ID:akaspin,項目名稱:bar,代碼行數:12,代碼來源:ttypes.go

示例6: writeField5

func (p *ServerInfo) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("bufferSize", thrift.I32, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:bufferSize: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.BufferSize)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.bufferSize (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:bufferSize: ", p), err)
	}
	return err
}
開發者ID:akaspin,項目名稱:bar,代碼行數:12,代碼來源:ttypes.go

示例7: writeField7

func (p *BinaryAnnotation) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("annotationType", thrift.I32, 7); err != nil {
		return fmt.Errorf("%T write field begin error 7:annotationType: %s", p, err)
	}
	if err := oprot.WriteI32(int32(p.AnnotationType)); err != nil {
		return fmt.Errorf("%T.annotationType (7) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 7:annotationType: %s", p, err)
	}
	return err
}
開發者ID:hustxiaoc,項目名稱:tchannel,代碼行數:12,代碼來源:ttypes.go

示例8: writeField2

func (p *Endpoint) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("port", thrift.I32, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:port: %s", p, err)
	}
	if err := oprot.WriteI32(int32(p.Port)); err != nil {
		return fmt.Errorf("%T.port (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:port: %s", p, err)
	}
	return err
}
開發者ID:hustxiaoc,項目名稱:tchannel,代碼行數:12,代碼來源:ttypes.go

示例9: writeField1

func (p *InvalidOperation) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Code)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err)
	}
	return err
}
開發者ID:LC2010,項目名稱:thrift-step-by-step-go,代碼行數:12,代碼來源:ttypes.go

示例10: writeField3

func (p *Request) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("op", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:op: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Op)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.op (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:op: ", p), err)
	}
	return err
}
開發者ID:LC2010,項目名稱:thrift-step-by-step-go,代碼行數:12,代碼來源:ttypes.go

示例11: writeField3

func (p *Annotation) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetDuration() {
		if err := oprot.WriteFieldBegin("duration", thrift.I32, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:duration: ", p), err)
		}
		if err := oprot.WriteI32(int32(*p.Duration)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.duration (3) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:duration: ", p), err)
		}
	}
	return err
}
開發者ID:dansimau,項目名稱:ringpop-go,代碼行數:14,代碼來源:ttypes.go

示例12: writeField4

func (p *Annotation) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetDuration() {
		if err := oprot.WriteFieldBegin("duration", thrift.I32, 4); err != nil {
			return fmt.Errorf("%T write field begin error 4:duration: %s", p, err)
		}
		if err := oprot.WriteI32(int32(*p.Duration)); err != nil {
			return fmt.Errorf("%T.duration (4) field write error: %s", p, err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 4:duration: %s", p, err)
		}
	}
	return err
}
開發者ID:cnicolov,項目名稱:kit,代碼行數:14,代碼來源:ttypes.go

示例13: writeField0

func (p *LogResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.I32, 0); err != nil {
			return fmt.Errorf("%T write field begin error 0:success: %s", p, err)
		}
		if err := oprot.WriteI32(int32(*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:cnicolov,項目名稱:kit,代碼行數:14,代碼來源:scribe.go


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