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

相關文章
相關標籤/搜索