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


Golang TProtocol.WriteI16方法代碼示例

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


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

示例1: writeField1

func (p *Flop) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("a", thrift.I16, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:a: %s", p, err)
	}
	if err := oprot.WriteI16(int16(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:karmakaze,項目名稱:ruby-go-thrift,代碼行數:12,代碼來源:ttypes.go

示例2: writeField2

func (p *Flop) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("b", thrift.I16, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:b: %s", p, err)
	}
	if err := oprot.WriteI16(int16(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:karmakaze,項目名稱:ruby-go-thrift,代碼行數:12,代碼來源:ttypes.go

示例3: writeField1

func (p *Types) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("short_value", thrift.I16, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:short_value: ", p), err)
	}
	if err := oprot.WriteI16(int16(p.ShortValue)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.short_value (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:short_value: ", p), err)
	}
	return err
}
開發者ID:y-okubo,項目名稱:thrift-test,代碼行數:12,代碼來源:ttypes.go

示例4: writeField2

func (p *Message) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("vote_type", thrift.I16, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vote_type: ", p), err)
	}
	if err := oprot.WriteI16(int16(p.VoteType)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.vote_type (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vote_type: ", p), err)
	}
	return err
}
開發者ID:wallacexinyu,項目名稱:Distributed-Productivity-Calendar,代碼行數:12,代碼來源:ttypes.go

示例5: writeField4

func (p *Student) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("sage", thrift.I16, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:sage: ", p), err)
	}
	if err := oprot.WriteI16(int16(p.Sage)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.sage (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:sage: ", p), err)
	}
	return err
}
開發者ID:wallacexinyu,項目名稱:Distributed-Productivity-Calendar,代碼行數:12,代碼來源:ttypes.go

示例6: writeField2

func (p *Endpoint) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("port", thrift.I16, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err)
	}
	if err := oprot.WriteI16(int16(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:elodina,項目名稱:go-zipkin,代碼行數:12,代碼來源:ttypes.go

示例7: writeField2

func (p *GetArgs) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("columnId", thrift.I16, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:columnId: %s", p, err)
	}
	if err := oprot.WriteI16(int16(p.ColumnId)); err != nil {
		return fmt.Errorf("%T.columnId (2) field write error: %s", p)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:columnId: %s", p, err)
	}
	return err
}
開發者ID:cosh,項目名稱:C4,代碼行數:12,代碼來源:c4.go

示例8: writeField5

func (p *Person) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("age", thrift.I16, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:age: ", p), err)
	}
	if err := oprot.WriteI16(int16(p.Age)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.age (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:age: ", p), err)
	}
	return err
}
開發者ID:dynastymasra,項目名稱:GolangThrift,代碼行數:12,代碼來源:ttypes.go

示例9: writeField0

func (p *CountResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.I16, 0); err != nil {
			return fmt.Errorf("%T write field begin error 0:success: %s", p, err)
		}
		if err := oprot.WriteI16(int16(*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:karmakaze,項目名稱:ruby-go-thrift,代碼行數:14,代碼來源:service.go


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