当前位置: 首页>>代码示例>>Golang>>正文


Golang TProtocol.WriteString方法代码示例

本文整理汇总了Golang中git/apache/org/thrift/git/lib/go/thrift.TProtocol.WriteString方法的典型用法代码示例。如果您正苦于以下问题:Golang TProtocol.WriteString方法的具体用法?Golang TProtocol.WriteString怎么用?Golang TProtocol.WriteString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在git/apache/org/thrift/git/lib/go/thrift.TProtocol的用法示例。


在下文中一共展示了TProtocol.WriteString方法的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: 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

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

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

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

示例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 *DestroyArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("contactId", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:contactId: %s", p, err)
	}
	if err := oprot.WriteString(string(p.ContactId)); err != nil {
		return fmt.Errorf("%T.contactId (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:contactId: %s", p, err)
	}
	return err
}
开发者ID:ianrtracey,项目名称:go-thrift,代码行数:12,代码来源:contactsvc.go

示例8: writeField2

func (p *SendShortMsgArgs) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("content", thrift.STRING, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:content: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Content)); err != nil {
		return fmt.Errorf("%T.content (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:content: %s", p, err)
	}
	return err
}
开发者ID:lei-yu,项目名称:GOPATH,代码行数:12,代码来源:smsmanager.go

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

示例10: writeField2

func (p *InvalidOperation) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("why", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:why: ", p), err)
	}
	if err := oprot.WriteString(string(p.Why)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.why (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:why: ", p), err)
	}
	return err
}
开发者ID:sktzwhj,项目名称:thrift-0.9.3,代码行数:12,代码来源:ttypes.go

示例11: writeField3

func (p *DadoTransporteThrift) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("cnesDadoSerializado", thrift.STRING, 3); err != nil {
		return fmt.Errorf("%T write field begin error 3:cnesDadoSerializado: %s", p, err)
	}
	if err := oprot.WriteString(string(p.CnesDadoSerializado)); err != nil {
		return fmt.Errorf("%T.cnesDadoSerializado (3) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 3:cnesDadoSerializado: %s", p, err)
	}
	return err
}
开发者ID:esusab,项目名称:integracao,代码行数:12,代码来源:ttypes.go

示例12: writeField3

func (p *Response) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("data", thrift.STRING, 3); err != nil {
		return fmt.Errorf("%T write field begin error 3:data: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Data)); err != nil {
		return fmt.Errorf("%T.data (3) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 3:data: %s", p, err)
	}
	return err
}
开发者ID:zhaorui1,项目名称:thrift-rpc-framework,代码行数:12,代码来源:ttypes.go

示例13: writeField2

func (p *Response) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("desc", thrift.STRING, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:desc: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Desc)); err != nil {
		return fmt.Errorf("%T.desc (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:desc: %s", p, err)
	}
	return err
}
开发者ID:zhaorui1,项目名称:thrift-rpc-framework,代码行数:12,代码来源:ttypes.go

示例14: writeField2

func (p *UException) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("errorMessage", thrift.STRING, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:errorMessage: %s", p, err)
	}
	if err := oprot.WriteString(string(p.ErrorMessage)); err != nil {
		return fmt.Errorf("%T.errorMessage (2) field write error: %s", p)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:errorMessage: %s", p, err)
	}
	return err
}
开发者ID:NotBadPad,项目名称:hbase-thrift-go,代码行数:12,代码来源:ttypes.go

示例15: writeField4

func (p *QueryResult) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("lastRow", thrift.STRING, 4); err != nil {
		return fmt.Errorf("%T write field begin error 4:lastRow: %s", p, err)
	}
	if err := oprot.WriteString(string(p.LastRow)); err != nil {
		return fmt.Errorf("%T.lastRow (4) field write error: %s", p)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 4:lastRow: %s", p, err)
	}
	return err
}
开发者ID:NotBadPad,项目名称:hbase-thrift-go,代码行数:12,代码来源:ttypes.go


注:本文中的git/apache/org/thrift/git/lib/go/thrift.TProtocol.WriteString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。