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


Golang TProtocol.WriteString方法代码示例

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


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

示例1: writeField0

func (p *FindAndAddContactsByUseridResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.MAP, 0); err != nil {
			return fmt.Errorf("%T write field begin error 0:success: %s", p, err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Success)); err != nil {
			return fmt.Errorf("error writing map begin: %s", err)
		}
		for k, v := range p.Success {
			if err := oprot.WriteString(string(k)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p, err)
			}
			if err := v.Write(oprot); err != nil {
				return fmt.Errorf("%T error writing struct: %s", v, err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return fmt.Errorf("error writing map end: %s", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 0:success: %s", p, err)
		}
	}
	return err
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:25,代码来源:findandaddcontactbyuserid.go

示例2: writeField3

func (p *LoginWithVerifierForCertificateArgs) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("verifier", thrift.STRING, 3); err != nil {
		return fmt.Errorf("%T write field begin error 3:verifier: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Verifier)); err != nil {
		return fmt.Errorf("%T.verifier (3) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 3:verifier: %s", p, err)
	}
	return err
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:12,代码来源:loginwithverifierforcertificate.go

示例3: writeField2

func (p *FindAndAddContactsByUseridArgs) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("userid", thrift.STRING, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:userid: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Userid)); err != nil {
		return fmt.Errorf("%T.userid (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:userid: %s", p, err)
	}
	return err
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:12,代码来源:findandaddcontactbyuserid.go

示例4: writeField2

func (p *GetLastReadMessageIdsArgs) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("chatId", thrift.STRING, 2); err != nil {
		return fmt.Errorf("%T write field begin error 2:chatId: %s", p, err)
	}
	if err := oprot.WriteString(string(p.ChatId)); err != nil {
		return fmt.Errorf("%T.chatId (2) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 2:chatId: %s", p, err)
	}
	return err
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:12,代码来源:messageservice.go

示例5: writeField9

func (p *LoginWithIdentityCredentialForCertificateArgs) writeField9(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("certificate", thrift.STRING, 9); err != nil {
		return fmt.Errorf("%T write field begin error 9:certificate: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Certificate)); err != nil {
		return fmt.Errorf("%T.certificate (9) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 9:certificate: %s", p, err)
	}
	return err
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:12,代码来源:loginwithidentitycredentialforcertificate.go

示例6: writeField7

func (p *LoginWithIdentityCredentialForCertificateArgs) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("systemName", thrift.STRING, 7); err != nil {
		return fmt.Errorf("%T write field begin error 7:systemName: %s", p, err)
	}
	if err := oprot.WriteString(string(p.SystemName)); err != nil {
		return fmt.Errorf("%T.systemName (7) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 7:systemName: %s", p, err)
	}
	return err
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:12,代码来源:loginwithidentitycredentialforcertificate.go

示例7: writeField6

func (p *LoginWithIdentityCredentialForCertificateArgs) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("accessLocation", thrift.STRING, 6); err != nil {
		return fmt.Errorf("%T write field begin error 6:accessLocation: %s", p, err)
	}
	if err := oprot.WriteString(string(p.AccessLocation)); err != nil {
		return fmt.Errorf("%T.accessLocation (6) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 6:accessLocation: %s", p, err)
	}
	return err
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:12,代码来源:loginwithidentitycredentialforcertificate.go

示例8: writeField4

func (p *LoginWithIdentityCredentialForCertificateArgs) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("password", thrift.STRING, 4); err != nil {
		return fmt.Errorf("%T write field begin error 4:password: %s", p, err)
	}
	if err := oprot.WriteString(string(p.Password)); err != nil {
		return fmt.Errorf("%T.password (4) field write error: %s", p, err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return fmt.Errorf("%T write field end error 4:password: %s", p, err)
	}
	return err
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:12,代码来源:loginwithidentitycredentialforcertificate.go

示例9: writeField0

func (p *GetAllContactIdsResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
			return fmt.Errorf("%T write field begin error 0:success: %s", p, err)
		}
		if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil {
			return fmt.Errorf("error writing list begin: %s", err)
		}
		for _, v := range p.Success {
			if err := oprot.WriteString(string(v)); err != nil {
				return fmt.Errorf("%T. (0) field write error: %s", p, err)
			}
		}
		if err := oprot.WriteListEnd(); err != nil {
			return fmt.Errorf("error writing list end: %s", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return fmt.Errorf("%T write field end error 0:success: %s", p, err)
		}
	}
	return err
}
开发者ID:justsurrender,项目名称:tsumtsum,代码行数:22,代码来源:getallcontactids.go


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