当前位置: 首页>>代码示例>>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;未经允许,请勿转载。