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


Golang TProtocol.ReadString方法代碼示例

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


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

示例1: readField1

func (p *ThriftIDLs) readField1(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return thrift.PrependError("error reading map begin: ", err)
	}
	tMap := make(map[Filename]string, size)
	p.Idls = tMap
	for i := 0; i < size; i++ {
		var _key0 Filename
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			temp := Filename(v)
			_key0 = temp
		}
		var _val1 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_val1 = v
		}
		p.Idls[_key0] = _val1
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return thrift.PrependError("error reading map end: ", err)
	}
	return nil
}
開發者ID:gosuper,項目名稱:tchannel-go,代碼行數:28,代碼來源:ttypes.go

示例2: ReadField3

func (p *Spec) ReadField3(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return thrift.PrependError("error reading map begin: ", err)
	}
	tMap := make(map[string]ID, size)
	p.Blobs = tMap
	for i := 0; i < size; i++ {
		var _key2 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_key2 = v
		}
		var _val3 ID
		if v, err := iprot.ReadBinary(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			temp := ID(v)
			_val3 = temp
		}
		p.Blobs[_key2] = _val3
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return thrift.PrependError("error reading map end: ", err)
	}
	return nil
}
開發者ID:akaspin,項目名稱:bar,代碼行數:28,代碼來源:ttypes.go

示例3: readField2

func (p *AddServiceConcatArgs) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.B = v
	}
	return nil
}
開發者ID:cnicolov,項目名稱:kit,代碼行數:8,代碼來源:addservice.go

示例4: readField0

func (p *AccountDoActionResult) readField0(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 0: ", err)
	} else {
		p.Success = &v
	}
	return nil
}
開發者ID:LC2010,項目名稱:thrift-step-by-step-go,代碼行數:8,代碼來源:account.go

示例5: ReadField2

func (p *DependencyLink) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 2: %s", err)
	} else {
		p.Child = v
	}
	return nil
}
開發者ID:cnicolov,項目名稱:kit,代碼行數:8,代碼來源:ttypes.go

示例6: ReadField2

func (p *LogEntry) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 2: %s", err)
	} else {
		p.Message = v
	}
	return nil
}
開發者ID:adriancole,項目名稱:go-zipkin,代碼行數:8,代碼來源:ttypes.go

示例7: readField3

func (p *Endpoint) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.ServiceName = v
	}
	return nil
}
開發者ID:ZhuJingfa,項目名稱:go-platform,代碼行數:8,代碼來源:ttypes.go

示例8: ReadField1

func (p *FirstEchoArgs) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Msg = v
	}
	return nil
}
開發者ID:uber,項目名稱:tchannel-go,代碼行數:8,代碼來源:first.go

示例9: ReadField0

func (p *GetResult) ReadField0(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 0: %s", err)
	} else {
		p.Success = &v
	}
	return nil
}
開發者ID:pengzhai,項目名稱:tchannel,代碼行數:8,代碼來源:keyvalue.go

示例10: readField1

func (p *Pong) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Source = v
	}
	return nil
}
開發者ID:dansimau,項目名稱:ringpop-go,代碼行數:8,代碼來源:ttypes.go

示例11: ReadField1

func (p *ConcatReply) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.Value = v
	}
	return nil
}
開發者ID:nimmen,項目名稱:kit,代碼行數:8,代碼來源:ttypes.go

示例12: ReadField3

func (p *Span) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 3: %s", err)
	} else {
		p.Name = v
	}
	return nil
}
開發者ID:taion809,項目名稱:go-zipkin,代碼行數:8,代碼來源:ttypes.go

示例13: readField2

func (p *NoPeersAvailable) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.ServiceName = v
	}
	return nil
}
開發者ID:gosuper,項目名稱:tchannel-go,代碼行數:8,代碼來源:ttypes.go

示例14: readField1

func (p *DiscoveryQuery) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.ServiceName = v
	}
	return nil
}
開發者ID:gosuper,項目名稱:tchannel-go,代碼行數:8,代碼來源:ttypes.go

示例15: ReadField1

func (p *EchoArgs) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return fmt.Errorf("error reading field 1: %s", err)
	} else {
		p.Arg = v
	}
	return nil
}
開發者ID:pengzhai,項目名稱:tchannel,代碼行數:8,代碼來源:secondservice.go


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