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


Golang TProtocol.ReadString方法代码示例

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


在下文中一共展示了TProtocol.ReadString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: ReadField0

func (p *BaseServiceGetInterfaceVersionsResult) ReadField0(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return thrift.PrependError("error reading map begin: ", err)
	}
	tMap := make(map[string]*version.Version, size)
	p.Success = tMap
	for i := 0; i < size; i++ {
		var _key12 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_key12 = v
		}
		_val13 := version.NewVersion()
		if err := _val13.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val13), err)
		}
		p.Success[_key12] = _val13
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return thrift.PrependError("error reading map end: ", err)
	}
	return nil
}
开发者ID:upfluence,项目名称:goutils,代码行数:25,代码来源:baseservice.go

示例2: ReadField0

func (p *MonitoringCollectResult) ReadField0(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return thrift.PrependError("error reading map begin: ", err)
	}
	tMap := make(Metrics, size)
	p.Success = tMap
	for i := 0; i < size; i++ {
		var _key5 MetricID
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			temp := MetricID(v)
			_key5 = temp
		}
		var _val6 float64
		if v, err := iprot.ReadDouble(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_val6 = v
		}
		p.Success[_key5] = _val6
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return thrift.PrependError("error reading map end: ", err)
	}
	return nil
}
开发者ID:upfluence,项目名称:goutils,代码行数:28,代码来源:monitoring.go

示例3: ReadField3

func (p *GitVersion) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.Branch = v
	}
	return nil
}
开发者ID:upfluence,项目名称:goutils,代码行数:8,代码来源:ttypes.go

示例4: ReadField1

func (p *ServiceNotAvailable) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Reason = v
	}
	return nil
}
开发者ID:upfluence,项目名称:goutils,代码行数:8,代码来源:ttypes.go

示例5: ReadField1

func (p *MonitoringCollectArgs) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]string, 0, size)
	p.Metrics = tSlice
	for i := 0; i < size; i++ {
		var _elem4 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem4 = v
		}
		p.Metrics = append(p.Metrics, _elem4)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}
开发者ID:upfluence,项目名称:goutils,代码行数:21,代码来源:monitoring.go


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