thrift 学习笔记

规则篇

namespace

The namespace scope indicates which language the namespace applies to;bash

a scope of '*' indicates that the namespace applies to all target languagesapp

field

structunionexception 和函数形参列表中的变量声明规则以下:函数

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)ui

概念:Conceptsspa

相关文章
相关标签/搜索