thrift 学习笔记
文章目录
规则篇
namespace
The namespace scope indicates which language the namespace applies to;
a scope of '*' indicates that the namespace applies to all target languages
field
struct、union、exception 和函数形参列表中的变量声明规则如下:
Field ::= FieldID? FieldReq? FieldType Identifier ('=' ConstValue)? XsdFieldOptions ListSeparator?
FieldID ::= IntConstant ':'
FieldReq ::= 'required' | 'optional'
FieldType ::= Identifier | BaseType | ContainerType
optional, required and default
| default | optional | required | |
|---|---|---|---|
| 是否生成 isset 函数 | 否 | 是 | 否 |
从 TProtocol 读取该字段时发现为空(read 失败) |
无事 | 无事 | error |
将该字段写入 TProtocol 时发现为空(write 失败) |
error | 无事 | error |
查询篇
语法:Interface Description Language (IDL)
概念:Concepts
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论