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


Golang TProtocol.WriteString方法代碼示例

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


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

示例1: writeField1

func (p *ServerInfo) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("httpEndpoint", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:httpEndpoint: ", p), err)
	}
	if err := oprot.WriteString(string(p.HttpEndpoint)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.httpEndpoint (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:httpEndpoint: ", p), err)
	}
	return err
}
開發者ID:akaspin,項目名稱:bar,代碼行數:12,代碼來源:ttypes.go

示例2: writeField2

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

示例3: writeField3

func (p *VersionInfo) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("version", thrift.STRING, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err)
	}
	if err := oprot.WriteString(string(p.Version)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err)
	}
	return err
}
開發者ID:gosuper,項目名稱:tchannel-go,代碼行數:12,代碼來源:ttypes.go

示例4: writeField2

func (p *LogEntry) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("message", thrift.STRING, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:message: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Message)); err != nil {
		return fmt.Errorf("%T.message (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:message: %s", p, err)
	}
	return err
}
開發者ID:adriancole,項目名稱:go-zipkin,代碼行數:12,代碼來源:ttypes.go

示例5: writeField1

func (p *DependencyLink) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("parent", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:parent: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Parent)); err != nil {
		return fmt.Errorf("%T.parent (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:parent: %s", p, err)
	}
	return err
}
開發者ID:cnicolov,項目名稱:kit,代碼行數:12,代碼來源:ttypes.go

示例6: writeField2

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

示例7: writeField1

func (p *Pong) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("source", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:source: ", p), err)
	}
	if err := oprot.WriteString(string(p.Source)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.source (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:source: ", p), err)
	}
	return err
}
開發者ID:dansimau,項目名稱:ringpop-go,代碼行數:12,代碼來源:ttypes.go

示例8: writeField1

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

示例9: writeField1

func (p *DiscoveryQuery) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("serviceName", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:serviceName: ", p), err)
	}
	if err := oprot.WriteString(string(p.ServiceName)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.serviceName (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:serviceName: ", p), err)
	}
	return err
}
開發者ID:gosuper,項目名稱:tchannel-go,代碼行數:12,代碼來源:ttypes.go

示例10: writeField3

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

示例11: writeField2

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

示例12: writeField1

func (p *EchoArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("arg", thrift.STRING, 1); err != nil {
		return fmt.Errorf("%T write field begin error 1:arg: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Arg)); err != nil {
		return fmt.Errorf("%T.arg (1) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 1:arg: %s", p, err)
	}
	return err
}
開發者ID:pengzhai,項目名稱:tchannel,代碼行數:12,代碼來源:secondservice.go

示例13: writeField2

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

示例14: writeField1

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

示例15: writeField1

func (p *SetArgs) 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:pengzhai,項目名稱:tchannel,代碼行數:12,代碼來源:keyvalue.go


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