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


Golang TProtocol.WriteListBegin方法代碼示例

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


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

示例1: writeField6

func (p *Span) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("annotations", thrift.LIST, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:annotations: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Annotations)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Annotations {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:annotations: ", p), err)
	}
	return err
}
開發者ID:elodina,項目名稱:go-zipkin,代碼行數:20,代碼來源:ttypes.go

示例2: writeField3

func (p *CitySvcCreateCityArgs) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("coords", thrift.LIST, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:coords: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Coords)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Coords {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:coords: ", p), err)
	}
	return err
}
開發者ID:sebsofen,項目名稱:sportapp-server,代碼行數:20,代碼來源:citysvc.go

示例3: writeField1

func (p *TestCase4Args) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("blog", thrift.LIST, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:blog: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Blog)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.Blog {
		if err := v.Write(oprot); err != nil {
			return fmt.Errorf("%T error writing struct: %s", v, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:blog: %s", p, err)
	}
	return err
}
開發者ID:amwicfai,項目名稱:go-example,代碼行數:20,代碼來源:blogservice.go

示例4: writeField8

func (p *Span) writeField8(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("binary_annotations", thrift.LIST, 8); err != nil {
		return fmt.Errorf("%T write field begin error 8:binary_annotations: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.BinaryAnnotations)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.BinaryAnnotations {
		if err := v.Write(oprot); err != nil {
			return fmt.Errorf("%T error writing struct: %s", v, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 8:binary_annotations: %s", p, err)
	}
	return err
}
開發者ID:no2key,項目名稱:monitor-1,代碼行數:20,代碼來源:ttypes.go

示例5: writeField4

func (p *AddTagArgs) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("tags", thrift.LIST, 4); err != nil {
		return fmt.Errorf("%T write field begin error 4:tags: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Tags)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.Tags {
		if err := oprot.WriteString(string(v)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 4:tags: %s", p, err)
	}
	return err
}
開發者ID:lei-yu,項目名稱:GOPATH,代碼行數:20,代碼來源:tagmanager.go

示例6: writeField1

func (p *DeletePrivateMessageArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("keyList", thrift.LIST, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:keyList: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.KeyList)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.KeyList {
		if err := v.Write(oprot); err != nil {
			return fmt.Errorf("%T error writing struct: %s", v, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:keyList: %s", p, err)
	}
	return err
}
開發者ID:lei-yu,項目名稱:GOPATH,代碼行數:20,代碼來源:privatemessagemanagersync.go

示例7: writeField3

func (p *ThriftColorGroup) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("colors", thrift.LIST, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:colors: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.Colors)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Colors {
		if err := oprot.WriteString(string(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:colors: ", p), err)
	}
	return err
}
開發者ID:smallnest,項目名稱:gosercomp,代碼行數:20,代碼來源:ttypes.go

示例8: writeField1

func (p *TerminalServicePushPendingRequestFormArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("forms", thrift.LIST, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:forms: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Forms)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Forms {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:forms: ", p), err)
	}
	return err
}
開發者ID:huodon,項目名稱:tyful,代碼行數:20,代碼來源:terminalservice.go

示例9: writeField11

func (p *Recommender) writeField11(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("displayItems", thrift.LIST, 11); err != nil {
		return fmt.Errorf("%T write field begin error 11:displayItems: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.DisplayItems)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.DisplayItems {
		if err := oprot.WriteString(string(v)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 11:displayItems: %s", p, err)
	}
	return err
}
開發者ID:qqliu,項目名稱:kibitz,代碼行數:20,代碼來源:ttypes.go

示例10: writeField1

func (p *AppendBatchArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("events", thrift.LIST, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:events: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Events)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.Events {
		if err := v.Write(oprot); err != nil {
			return fmt.Errorf("%T error writing struct: %s", v, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:events: %s", p, err)
	}
	return err
}
開發者ID:ceocoder,項目名稱:glumelogger,代碼行數:20,代碼來源:thriftsourceprotocol.go

示例11: writeField2

func (p *DeleteRemindingMsgByTypeArgs) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("types", thrift.LIST, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:types: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.I32, len(p.Types)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.Types {
		if err := oprot.WriteI32(int32(v)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:types: %s", p, err)
	}
	return err
}
開發者ID:lei-yu,項目名稱:GOPATH,代碼行數:20,代碼來源:remindingmanager.go

示例12: writeField3

func (p *Coffee) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("sweetners", thrift.LIST, 3); err != nil {
		return fmt.Errorf("%T write field begin error 3:sweetners: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Sweetners)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.Sweetners {
		if err := v.Write(oprot); err != nil {
			return fmt.Errorf("%T error writing struct: %s", v, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 3:sweetners: %s", p, err)
	}
	return err
}
開發者ID:RobWC,項目名稱:thrift-coffee,代碼行數:20,代碼來源:ttypes.go

示例13: writeField3

func (p *GrantUserAccessToGroupRegionArgs) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("zones", thrift.LIST, 3); err != nil {
		return fmt.Errorf("%T write field begin error 3:zones: %s", p, err)
	}
	if err := oprot.WriteListBegin(thrift.I32, len(p.Zones)); err != nil {
		return fmt.Errorf("error writing list begin: %s", err)
	}
	for _, v := range p.Zones {
		if err := oprot.WriteI32(int32(v)); err != nil {
			return fmt.Errorf("%T. (0) field write error: %s", p, err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return fmt.Errorf("error writing list end: %s", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 3:zones: %s", p, err)
	}
	return err
}
開發者ID:lei-yu,項目名稱:GOPATH,代碼行數:20,代碼來源:accessmanager.go

示例14: writeField7

func (p *FichaVisitaDomiciliarChildThrift) writeField7(oprot thrift.TProtocol) (err error) {
	if p.IsSetMotivosVisita() {
		if err := oprot.WriteFieldBegin("motivosVisita", thrift.LIST, 7); err != nil {
			return fmt.Errorf("%T write field begin error 7:motivosVisita: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.I64, len(p.MotivosVisita)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.MotivosVisita {
			if err := oprot.WriteI64(int64(v)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p, err)
			}
		}
		if err := oprot.WriteListEnd(); err != nil {
			return fmt.Errorf("error writing list end: %s", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 7:motivosVisita: %s", p, err)
		}
	}
	return err
}
開發者ID:esusab,項目名稱:integracao,代碼行數:22,代碼來源:ttypes.go

示例15: writeField5

func (p *QueryResult) writeField5(oprot thrift.TProtocol) (err error) {
	if p.VmMoneyList != nil {
		if err := oprot.WriteFieldBegin("vmMoneyList", thrift.LIST, 5); err != nil {
			return fmt.Errorf("%T write field begin error 5:vmMoneyList: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.VmMoneyList)); err != nil {
			return fmt.Errorf("error writing list begin: %s")
		}
		for _, v := range p.VmMoneyList {
			if err := v.Write(oprot); err != nil {
				return fmt.Errorf("%T error writing struct: %s", v)
			}
		}
		if err := oprot.WriteListEnd(); err != nil {
			return fmt.Errorf("error writing list end: %s")
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 5:vmMoneyList: %s", p, err)
		}
	}
	return err
}
開發者ID:NotBadPad,項目名稱:hbase-thrift-go,代碼行數:22,代碼來源:ttypes.go


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