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


Golang TProtocol.ReadString方法代碼示例

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


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

示例1: ReadField3

func (p *RestRequest) ReadField3(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return fmt.Errorf("error reading map begin: %s", err)
	}
	tMap := make(map[string]string, size)
	p.Parameters = tMap
	for i := 0; i < size; i++ {
		var _key0 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_key0 = v
		}
		var _val1 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_val1 = v
		}
		p.Parameters[_key0] = _val1
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return fmt.Errorf("error reading map end: %s", err)
	}
	return nil
}
開發者ID:fayizk1,項目名稱:gen-go,代碼行數:27,代碼來源:ttypes.go

示例2: ReadField2

func (p *RestResponse) ReadField2(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return fmt.Errorf("error reading map begin: %s", err)
	}
	tMap := make(map[string]string, size)
	p.Headers = tMap
	for i := 0; i < size; i++ {
		var _key4 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_key4 = v
		}
		var _val5 string
		if v, err := iprot.ReadString(); err != nil {
			return fmt.Errorf("error reading field 0: %s", err)
		} else {
			_val5 = v
		}
		p.Headers[_key4] = _val5
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return fmt.Errorf("error reading map end: %s", err)
	}
	return nil
}
開發者ID:fayizk1,項目名稱:gen-go,代碼行數:27,代碼來源:ttypes.go

示例3: readField1

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

示例4: ReadField1

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

示例5: readField5

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

示例6: ReadField0

func (p *Echo2timesResult) 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:WitzHsiao,項目名稱:ThriftSample,代碼行數:8,代碼來源:echosrv.go

示例7: ReadField1

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


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