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


Golang TProtocol.WriteFieldEnd方法代碼示例

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


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

示例1: writeField9

func (p *Types) writeField9(oprot thrift.TProtocol) (err error) {
	if p.IsSetMapValue() {
		if err := oprot.WriteFieldBegin("map_value", thrift.MAP, 9); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:map_value: ", p), err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.I32, len(p.MapValue)); err != nil {
			return thrift.PrependError("error writing map begin: ", err)
		}
		for k, v := range p.MapValue {
			if err := oprot.WriteString(string(k)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
			if err := oprot.WriteI32(int32(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return thrift.PrependError("error writing map end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 9:map_value: ", p), err)
		}
	}
	return err
}
開發者ID:y-okubo,項目名稱:thrift-test,代碼行數:25,代碼來源:ttypes.go

示例2: writeField3

func (p *FunCallArgs) writeField3(oprot thrift.TProtocol) (err error) {
	if p.ParamMap != nil {
		if err := oprot.WriteFieldBegin("paramMap", thrift.MAP, 3); err != nil {
			return fmt.Errorf("%T write field begin error 3:paramMap: %s", p, err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.ParamMap)); err != nil {
			return fmt.Errorf("error writing map begin: %s")
		}
		for k, v := range p.ParamMap {
			if err := oprot.WriteString(string(k)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p)
			}
			if err := oprot.WriteString(string(v)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return fmt.Errorf("error writing map end: %s")
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 3:paramMap: %s", p, err)
		}
	}
	return err
}
開發者ID:citysir,項目名稱:zpush,代碼行數:25,代碼來源:push_service.go

示例3: writeField1

func (p *NoStdJson) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetOne() {
		if err := oprot.WriteFieldBegin("one", thrift.MAP, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:one: ", p), err)
		}
		if err := oprot.WriteMapBegin(thrift.I64, thrift.STRING, len(p.One)); err != nil {
			return thrift.PrependError("error writing map begin: ", err)
		}
		for k, v := range p.One {
			if err := oprot.WriteI64(int64(k)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
			if err := oprot.WriteString(string(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return thrift.PrependError("error writing map end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:one: ", p), err)
		}
	}
	return err
}
開發者ID:peter-edge,項目名稱:lion-go,代碼行數:25,代碼來源:ttypes.go

示例4: writeField1

func (p *ThriftFlumeEvent) writeField1(oprot thrift.TProtocol) (err error) {
	if p.Headers != nil {
		if err := oprot.WriteFieldBegin("headers", thrift.MAP, 1); err != nil {
			return fmt.Errorf("%T write field begin error 1:headers: %s", p, err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Headers)); err != nil {
			return fmt.Errorf("error writing map begin: %s")
		}
		for k, v := range p.Headers {
			if err := oprot.WriteString(string(k)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p)
			}
			if err := oprot.WriteString(string(v)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return fmt.Errorf("error writing map end: %s")
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 1:headers: %s", p, err)
		}
	}
	return err
}
開發者ID:rejoicelee,項目名稱:flume-log-sdk,代碼行數:25,代碼來源:ttypes.go

示例5: writeField2

func (p *Result) writeField2(oprot thrift.TProtocol) (err error) {
	if p.Palette != nil {
		if err := oprot.WriteFieldBegin("palette", thrift.MAP, 2); err != nil {
			return fmt.Errorf("%T write field begin error 2:palette: %s", p, err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Palette)); err != nil {
			return fmt.Errorf("error writing map begin: %s")
		}
		for k, v := range p.Palette {
			if err := oprot.WriteString(string(k)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p)
			}
			if err := v.Write(oprot); err != nil {
				return fmt.Errorf("%T error writing struct: %s", v)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return fmt.Errorf("error writing map end: %s")
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 2:palette: %s", p, err)
		}
	}
	return err
}
開發者ID:improvemedia,項目名稱:colorcandy,代碼行數:25,代碼來源:ttypes.go

示例6: writeField5

func (p *Entry) writeField5(oprot thrift.TProtocol) (err error) {
	if p.IsSetFields() {
		if err := oprot.WriteFieldBegin("fields", thrift.MAP, 5); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:fields: ", p), err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Fields)); err != nil {
			return thrift.PrependError("error writing map begin: ", err)
		}
		for k, v := range p.Fields {
			if err := oprot.WriteString(string(k)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
			if err := oprot.WriteString(string(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return thrift.PrependError("error writing map end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 5:fields: ", p), err)
		}
	}
	return err
}
開發者ID:peter-edge,項目名稱:lion-go,代碼行數:25,代碼來源:ttypes.go

示例7: writeField1

func (p *GetLockArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("calendarName", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:calendarName: ", p), err)
	}
	if err := oprot.WriteString(string(p.CalendarName)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.calendarName (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:calendarName: ", p), err)
	}
	return err
}
開發者ID:wallacexinyu,項目名稱:Distributed-Productivity-Calendar,代碼行數:12,代碼來源:myservice.go

示例8: writeField1

func (p *CreateArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("contact", thrift.STRUCT, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:contact: %s", p, err)
	}
	if err := p.Contact.Write(oprot); err != nil {
		return fmt.Errorf("%T error writing struct: %s", p.Contact, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:contact: %s", p, err)
	}
	return err
}
開發者ID:ianrtracey,項目名稱:go-thrift,代碼行數:12,代碼來源:contactsvc.go

示例9: writeField3

func (p *SendShortMsgArgs) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("zone", thrift.STRING, 3); err != nil {
		return fmt.Errorf("%T write field begin error 3:zone: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Zone)); err != nil {
		return fmt.Errorf("%T.zone (3) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 3:zone: %s", p, err)
	}
	return err
}
開發者ID:lei-yu,項目名稱:GOPATH,代碼行數:12,代碼來源:smsmanager.go

示例10: writeField1

func (p *SendShortMsgArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("phoneNumber", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:phoneNumber: %s", p, err)
	}
	if err := oprot.WriteString(string(p.PhoneNumber)); err != nil {
		return fmt.Errorf("%T.phoneNumber (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:phoneNumber: %s", p, err)
	}
	return err
}
開發者ID:lei-yu,項目名稱:GOPATH,代碼行數:12,代碼來源:smsmanager.go

示例11: writeField1

func (p *UpdateStatusArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:key: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Key)); err != nil {
		return fmt.Errorf("%T.key (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:key: %s", p, err)
	}
	return err
}
開發者ID:lei-yu,項目名稱:GOPATH,代碼行數:12,代碼來源:statusmanagersync.go

示例12: writeField2

func (p *RpcException) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:msg: ", p), err)
	}
	if err := oprot.WriteString(string(p.Msg)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.msg (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:msg: ", p), err)
	}
	return err
}
開發者ID:jinhy,項目名稱:rpc_proxy,代碼行數:12,代碼來源:ttypes.go

示例13: writeField3

func (p *Work) 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:sktzwhj,項目名稱:thrift-0.9.3,代碼行數:12,代碼來源:ttypes.go

示例14: writeField1

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

示例15: writeField1

func (p *GetPrivateMessageListArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("uid", thrift.I64, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:uid: %s", p, err)
	}
	if err := oprot.WriteI64(int64(p.Uid)); err != nil {
		return fmt.Errorf("%T.uid (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:uid: %s", p, err)
	}
	return err
}
開發者ID:lei-yu,項目名稱:GOPATH,代碼行數:12,代碼來源:privatemessagemanagersync.go


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