Documentation
¶
Overview ¶
Code generated by thriftgo (0.4.1) (fastgo). DO NOT EDIT.
Package parser parses a thrift IDL file with its dependencies into an abstract syntax tree. The acceptable IDL grammar is defined in the 'thrift.peg' file.
Index ¶
- Constants
- Variables
- func CircleDetect(ast *Thrift) string
- func DetectKeyword(t *Thrift) (warnings []string)
- func Pretty(pretty bool) func(*ThriftIDL) error
- func Size(size int) func(*ThriftIDL) error
- func Typename2TypeID(name string) uint8
- type Annotation
- func (p *Annotation) BLength() int
- func (p *Annotation) FastAppend(b []byte) []byte
- func (p *Annotation) FastRead(b []byte) (off int, err error)
- func (p *Annotation) FastWrite(b []byte) int
- func (p *Annotation) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *Annotation) GetKey() (v string)
- func (p *Annotation) GetValues() (v []string)
- func (p *Annotation) InitDefault()
- func (p *Annotation) String() string
- type Annotations
- type Category
- func (p Category) IsBaseType() bool
- func (p Category) IsBinary() bool
- func (p Category) IsBool() bool
- func (p Category) IsByte() bool
- func (p Category) IsConstant() bool
- func (p Category) IsContainerType() bool
- func (p Category) IsDouble() bool
- func (p Category) IsEnum() bool
- func (p Category) IsException() bool
- func (p Category) IsI16() bool
- func (p Category) IsI32() bool
- func (p Category) IsI64() bool
- func (p Category) IsList() bool
- func (p Category) IsMap() bool
- func (p Category) IsService() bool
- func (p Category) IsSet() bool
- func (p Category) IsString() bool
- func (p Category) IsStruct() bool
- func (p Category) IsStructLike() bool
- func (p Category) IsTypedef() bool
- func (p Category) IsUnion() bool
- func (p *Category) Scan(value interface{}) (err error)
- func (p Category) String() string
- func (p *Category) Value() (driver.Value, error)
- type ConstType
- type ConstTypedValue
- func (p *ConstTypedValue) BLength() int
- func (p *ConstTypedValue) CountSetFieldsConstTypedValue() int
- func (p *ConstTypedValue) FastAppend(b []byte) []byte
- func (p *ConstTypedValue) FastRead(b []byte) (off int, err error)
- func (p *ConstTypedValue) FastWrite(b []byte) int
- func (p *ConstTypedValue) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *ConstTypedValue) GetDouble() (v float64)
- func (p *ConstTypedValue) GetIdentifier() (v string)
- func (p *ConstTypedValue) GetInt() (v int64)
- func (p *ConstTypedValue) GetList() (v []*ConstValue)
- func (p *ConstTypedValue) GetLiteral() (v string)
- func (p *ConstTypedValue) GetMap() (v []*MapConstValue)
- func (p *ConstTypedValue) InitDefault()
- func (p *ConstTypedValue) IsSetDouble() bool
- func (p *ConstTypedValue) IsSetIdentifier() bool
- func (p *ConstTypedValue) IsSetInt() bool
- func (p *ConstTypedValue) IsSetList() bool
- func (p *ConstTypedValue) IsSetLiteral() bool
- func (p *ConstTypedValue) IsSetMap() bool
- func (p *ConstTypedValue) String() string
- type ConstValue
- func (p *ConstValue) BLength() int
- func (p *ConstValue) FastAppend(b []byte) []byte
- func (p *ConstValue) FastRead(b []byte) (off int, err error)
- func (p *ConstValue) FastWrite(b []byte) int
- func (p *ConstValue) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *ConstValue) GetExtra() (v *ConstValueExtra)
- func (p *ConstValue) GetType() (v ConstType)
- func (p *ConstValue) GetTypedValue() (v *ConstTypedValue)
- func (p *ConstValue) InitDefault()
- func (p *ConstValue) IsSetExtra() bool
- func (p *ConstValue) IsSetTypedValue() bool
- func (t *ConstValue) String() string
- type ConstValueExtra
- func (p *ConstValueExtra) BLength() int
- func (p *ConstValueExtra) FastAppend(b []byte) []byte
- func (p *ConstValueExtra) FastRead(b []byte) (off int, err error)
- func (p *ConstValueExtra) FastWrite(b []byte) int
- func (p *ConstValueExtra) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *ConstValueExtra) GetIndex() (v int32)
- func (p *ConstValueExtra) GetIsEnum() (v bool)
- func (p *ConstValueExtra) GetName() (v string)
- func (p *ConstValueExtra) GetSel() (v string)
- func (p *ConstValueExtra) InitDefault()
- func (p *ConstValueExtra) String() string
- type Constant
- func (p *Constant) BLength() int
- func (p *Constant) FastAppend(b []byte) []byte
- func (p *Constant) FastRead(b []byte) (off int, err error)
- func (p *Constant) FastWrite(b []byte) int
- func (p *Constant) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *Constant) GetAnnotations() (v Annotations)
- func (p *Constant) GetName() (v string)
- func (p *Constant) GetReservedComments() (v string)
- func (p *Constant) GetType() (v *Type)
- func (p *Constant) GetValue() (v *ConstValue)
- func (p *Constant) InitDefault()
- func (p *Constant) IsSetType() bool
- func (p *Constant) IsSetValue() bool
- func (p *Constant) String() string
- type Enum
- func (p *Enum) BLength() int
- func (p *Enum) FastAppend(b []byte) []byte
- func (p *Enum) FastRead(b []byte) (off int, err error)
- func (p *Enum) FastWrite(b []byte) int
- func (p *Enum) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *Enum) GetAnnotations() (v Annotations)
- func (p *Enum) GetName() (v string)
- func (p *Enum) GetReservedComments() (v string)
- func (p *Enum) GetValues() (v []*EnumValue)
- func (p *Enum) InitDefault()
- func (p *Enum) String() string
- type EnumValue
- func (p *EnumValue) BLength() int
- func (p *EnumValue) FastAppend(b []byte) []byte
- func (p *EnumValue) FastRead(b []byte) (off int, err error)
- func (p *EnumValue) FastWrite(b []byte) int
- func (p *EnumValue) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *EnumValue) GetAnnotations() (v Annotations)
- func (p *EnumValue) GetName() (v string)
- func (p *EnumValue) GetReservedComments() (v string)
- func (p *EnumValue) GetValue() (v int64)
- func (p *EnumValue) InitDefault()
- func (p *EnumValue) String() string
- type Field
- func (p *Field) BLength() int
- func (p *Field) FastAppend(b []byte) []byte
- func (p *Field) FastRead(b []byte) (off int, err error)
- func (p *Field) FastWrite(b []byte) int
- func (p *Field) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *Field) GetAnnotations() (v Annotations)
- func (p *Field) GetDefault() (v *ConstValue)
- func (p *Field) GetID() (v int32)
- func (p *Field) GetName() (v string)
- func (p *Field) GetRequiredness() (v FieldType)
- func (p *Field) GetReservedComments() (v string)
- func (p *Field) GetType() (v *Type)
- func (p *Field) InitDefault()
- func (p *Field) IsSetDefault() bool
- func (p *Field) IsSetType() bool
- func (p *Field) String() string
- type FieldType
- type Function
- func (p *Function) BLength() int
- func (p *Function) FastAppend(b []byte) []byte
- func (p *Function) FastRead(b []byte) (off int, err error)
- func (p *Function) FastWrite(b []byte) int
- func (p *Function) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *Function) ForEachArgument(f func(v *Field) bool)
- func (p *Function) ForEachThrow(f func(v *Field) bool)
- func (p *Function) GetAnnotations() (v Annotations)
- func (p *Function) GetArguments() (v []*Field)
- func (p *Function) GetFunctionType() (v *Type)
- func (p *Function) GetName() (v string)
- func (p *Function) GetOneway() (v bool)
- func (p *Function) GetReservedComments() (v string)
- func (p *Function) GetThrows() (v []*Field)
- func (p *Function) GetVoid() (v bool)
- func (p *Function) InitDefault()
- func (p *Function) IsSetFunctionType() bool
- func (p *Function) String() string
- type Include
- func (p *Include) BLength() int
- func (p *Include) FastAppend(b []byte) []byte
- func (p *Include) FastRead(b []byte) (off int, err error)
- func (p *Include) FastWrite(b []byte) int
- func (p *Include) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *Include) GetPath() (v string)
- func (p *Include) GetReference() (v *Thrift)
- func (p *Include) GetUsed() (v bool)
- func (p *Include) InitDefault()
- func (p *Include) IsSetReference() bool
- func (p *Include) IsSetUsed() bool
- func (p *Include) String() string
- type MapConstValue
- func (p *MapConstValue) BLength() int
- func (p *MapConstValue) FastAppend(b []byte) []byte
- func (p *MapConstValue) FastRead(b []byte) (off int, err error)
- func (p *MapConstValue) FastWrite(b []byte) int
- func (p *MapConstValue) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *MapConstValue) GetKey() (v *ConstValue)
- func (p *MapConstValue) GetValue() (v *ConstValue)
- func (p *MapConstValue) InitDefault()
- func (p *MapConstValue) IsSetKey() bool
- func (p *MapConstValue) IsSetValue() bool
- func (p *MapConstValue) String() string
- type Namespace
- func (p *Namespace) BLength() int
- func (p *Namespace) FastAppend(b []byte) []byte
- func (p *Namespace) FastRead(b []byte) (off int, err error)
- func (p *Namespace) FastWrite(b []byte) int
- func (p *Namespace) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *Namespace) GetAnnotations() (v Annotations)
- func (p *Namespace) GetLanguage() (v string)
- func (p *Namespace) GetName() (v string)
- func (p *Namespace) InitDefault()
- func (p *Namespace) String() string
- type Reference
- func (p *Reference) BLength() int
- func (p *Reference) FastAppend(b []byte) []byte
- func (p *Reference) FastRead(b []byte) (off int, err error)
- func (p *Reference) FastWrite(b []byte) int
- func (p *Reference) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *Reference) GetIndex() (v int32)
- func (p *Reference) GetName() (v string)
- func (p *Reference) InitDefault()
- func (p *Reference) String() string
- type Service
- func (p *Service) BLength() int
- func (p *Service) FastAppend(b []byte) []byte
- func (p *Service) FastRead(b []byte) (off int, err error)
- func (p *Service) FastWrite(b []byte) int
- func (p *Service) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (s *Service) ForEachFunction(f func(v *Function) bool)
- func (p *Service) GetAnnotations() (v Annotations)
- func (p *Service) GetExtends() (v string)
- func (p *Service) GetFunctions() (v []*Function)
- func (p *Service) GetName() (v string)
- func (p *Service) GetReference() (v *Reference)
- func (p *Service) GetReservedComments() (v string)
- func (p *Service) InitDefault()
- func (p *Service) IsSetReference() bool
- func (p *Service) String() string
- type StructLike
- func (p *StructLike) BLength() int
- func (p *StructLike) FastAppend(b []byte) []byte
- func (p *StructLike) FastRead(b []byte) (off int, err error)
- func (p *StructLike) FastWrite(b []byte) int
- func (p *StructLike) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (s *StructLike) ForEachField(f func(v *Field) bool)
- func (p *StructLike) GetAnnotations() (v Annotations)
- func (p *StructLike) GetCategory() (v string)
- func (s *StructLike) GetField(name string) (*Field, bool)
- func (p *StructLike) GetFields() (v []*Field)
- func (p *StructLike) GetName() (v string)
- func (p *StructLike) GetReservedComments() (v string)
- func (p *StructLike) InitDefault()
- func (p *StructLike) String() string
- type Thrift
- func (p *Thrift) BLength() int
- func (t *Thrift) DepthFirstSearch() chan *Thrift
- func (p *Thrift) FastAppend(b []byte) []byte
- func (p *Thrift) FastRead(b []byte) (off int, err error)
- func (p *Thrift) FastWrite(b []byte) int
- func (p *Thrift) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (t *Thrift) ForEachConstant(f func(v *Constant) bool)
- func (t *Thrift) ForEachEnum(f func(v *Enum) bool)
- func (t *Thrift) ForEachException(f func(v *StructLike) bool)
- func (t *Thrift) ForEachInclude(f func(v *Include) bool)
- func (t *Thrift) ForEachNamepace(f func(v *Namespace) bool)
- func (t *Thrift) ForEachService(f func(v *Service) bool)
- func (t *Thrift) ForEachStruct(f func(v *StructLike) bool)
- func (t *Thrift) ForEachStructLike(f func(v *StructLike) bool)
- func (t *Thrift) ForEachTypedef(f func(v *Typedef) bool)
- func (t *Thrift) ForEachUnion(f func(v *StructLike) bool)
- func (t *Thrift) GetConstant(name string) (*Constant, bool)
- func (p *Thrift) GetConstants() (v []*Constant)
- func (p *Thrift) GetCppIncludes() (v []string)
- func (t *Thrift) GetEnum(name string) (*Enum, bool)
- func (p *Thrift) GetEnums() (v []*Enum)
- func (t *Thrift) GetException(name string) (*StructLike, bool)
- func (p *Thrift) GetExceptions() (v []*StructLike)
- func (p *Thrift) GetFilename() (v string)
- func (p *Thrift) GetIncludes() (v []*Include)
- func (p *Thrift) GetName2Category() (v map[string]Category)
- func (t *Thrift) GetNamespace(lang string) (ns string, found bool)
- func (t *Thrift) GetNamespaceOrReferenceName(lang string) string
- func (p *Thrift) GetNamespaces() (v []*Namespace)
- func (t *Thrift) GetReference(refname string) (*Thrift, bool)
- func (t *Thrift) GetService(name string) (*Service, bool)
- func (p *Thrift) GetServices() (v []*Service)
- func (t *Thrift) GetStruct(name string) (*StructLike, bool)
- func (t *Thrift) GetStructLikes() (ss []*StructLike)
- func (p *Thrift) GetStructs() (v []*StructLike)
- func (t *Thrift) GetTypedef(alias string) (*Typedef, bool)
- func (p *Thrift) GetTypedefs() (v []*Typedef)
- func (t *Thrift) GetUnion(name string) (*StructLike, bool)
- func (p *Thrift) GetUnions() (v []*StructLike)
- func (p *Thrift) InitDefault()
- func (p *Thrift) String() string
- type ThriftIDL
- func (t *ThriftIDL) AST() *node32
- func (t *ThriftIDL) Add(rule pegRule, begin, end, index uint32)
- func (p *ThriftIDL) Init(options ...func(*ThriftIDL) error) error
- func (p *ThriftIDL) Parse(rule ...int) error
- func (t *ThriftIDL) PrettyPrintSyntaxTree(buffer string)
- func (t *ThriftIDL) Print()
- func (p *ThriftIDL) PrintSyntaxTree()
- func (p *ThriftIDL) Reset()
- func (p *ThriftIDL) SprintSyntaxTree() string
- func (t *ThriftIDL) Tokens() []token32
- func (t *ThriftIDL) Trim(length uint32)
- func (p *ThriftIDL) WriteSyntaxTree(w io.Writer)
- type Type
- func (p *Type) BLength() int
- func (p *Type) FastAppend(b []byte) []byte
- func (p *Type) FastRead(b []byte) (off int, err error)
- func (p *Type) FastWrite(b []byte) int
- func (p *Type) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *Type) GetAnnotations() (v Annotations)
- func (p *Type) GetCategory() (v Category)
- func (p *Type) GetCppType() (v string)
- func (p *Type) GetIsTypedef() (v bool)
- func (p *Type) GetKeyType() (v *Type)
- func (p *Type) GetName() (v string)
- func (p *Type) GetReference() (v *Reference)
- func (p *Type) GetValueType() (v *Type)
- func (p *Type) InitDefault()
- func (p *Type) IsSetIsTypedef() bool
- func (p *Type) IsSetKeyType() bool
- func (p *Type) IsSetReference() bool
- func (p *Type) IsSetValueType() bool
- func (t *Type) String() string
- type Typedef
- func (p *Typedef) BLength() int
- func (p *Typedef) FastAppend(b []byte) []byte
- func (p *Typedef) FastRead(b []byte) (off int, err error)
- func (p *Typedef) FastWrite(b []byte) int
- func (p *Typedef) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
- func (p *Typedef) GetAlias() (v string)
- func (p *Typedef) GetAnnotations() (v Annotations)
- func (p *Typedef) GetName() (v string)
- func (p *Typedef) GetReservedComments() (v string)
- func (p *Typedef) GetType() (v *Type)
- func (p *Typedef) InitDefault()
- func (p *Typedef) IsSetType() bool
- func (p *Typedef) String() string
Constants ¶
const ( STOP = 0 VOID = 1 BOOL = 2 BYTE = 3 I08 = 3 DOUBLE = 4 I16 = 6 I32 = 8 I64 = 10 STRING = 11 UTF7 = 11 STRUCT = 12 MAP = 13 SET = 14 LIST = 15 UTF8 = 16 UTF16 = 17 BINARY = 18 UNKNOWN = 255 )
TType constants in the Thrift protocol.
const NOTSET = -999999
NOTSET is a value to express 'not set'.
Variables ¶
var ConstTypedValue_Double_DEFAULT float64
var ConstTypedValue_Identifier_DEFAULT string
var ConstTypedValue_Int_DEFAULT int64
var ConstTypedValue_List_DEFAULT []*ConstValue
var ConstTypedValue_Literal_DEFAULT string
var ConstTypedValue_Map_DEFAULT []*MapConstValue
var Include_Used_DEFAULT bool
var ThriftGoUnusedProtection = struct{}{}
var Type_IsTypedef_DEFAULT bool
Functions ¶
func CircleDetect ¶
CircleDetect detects whether there is an include circle and return a string representing the loop. When no include circle is found, it returns an empty string.
func DetectKeyword ¶ added in v0.2.0
DetectKeyword detects if there is any identifier using a reserved word in common programming languages.
func Typename2TypeID ¶
Typename2TypeID converts a TypeID name to its value.
Types ¶
type Annotation ¶ added in v0.1.2
type Annotation struct {
Key string `thrift:"Key,1" frugal:"1,default,string" json:"Key"`
Values []string `thrift:"Values,2" frugal:"2,default,list<string>" json:"Values"`
}
func NewAnnotation ¶ added in v0.1.2
func NewAnnotation() *Annotation
func (*Annotation) BLength ¶ added in v0.4.2
func (p *Annotation) BLength() int
func (*Annotation) FastAppend ¶ added in v0.4.2
func (p *Annotation) FastAppend(b []byte) []byte
func (*Annotation) FastRead ¶ added in v0.4.2
func (p *Annotation) FastRead(b []byte) (off int, err error)
func (*Annotation) FastWrite ¶ added in v0.4.2
func (p *Annotation) FastWrite(b []byte) int
func (*Annotation) FastWriteNocopy ¶ added in v0.4.2
func (p *Annotation) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*Annotation) GetKey ¶ added in v0.1.2
func (p *Annotation) GetKey() (v string)
func (*Annotation) GetValues ¶ added in v0.1.2
func (p *Annotation) GetValues() (v []string)
func (*Annotation) InitDefault ¶ added in v0.4.2
func (p *Annotation) InitDefault()
func (*Annotation) String ¶ added in v0.1.2
func (p *Annotation) String() string
type Annotations ¶ added in v0.1.2
type Annotations []*Annotation
func (*Annotations) Append ¶ added in v0.1.2
func (a *Annotations) Append(key, value string)
Append append key value pair to Annotation slice.
func (*Annotations) Get ¶ added in v0.1.2
func (a *Annotations) Get(key string) []string
Get return annotations values.
func (*Annotations) ILocValueByKey ¶ added in v0.3.2
func (a *Annotations) ILocValueByKey(key string, idx int) string
ILocValueByKey return annotation value by key and index.
type Category ¶ added in v0.1.2
type Category int64
const ( Category_Constant Category = 0 Category_Bool Category = 1 Category_Byte Category = 2 Category_I16 Category = 3 Category_I32 Category = 4 Category_I64 Category = 5 Category_Double Category = 6 Category_String Category = 7 Category_Binary Category = 8 Category_Map Category = 9 Category_List Category = 10 Category_Set Category = 11 Category_Enum Category = 12 Category_Struct Category = 13 Category_Union Category = 14 Category_Exception Category = 15 Category_Typedef Category = 16 Category_Service Category = 17 )
func CategoryFromString ¶ added in v0.1.2
func CategoryPtr ¶ added in v0.1.2
func (Category) IsBaseType ¶ added in v0.1.2
IsBaseType tells if the category is one of the basetypes.
func (Category) IsConstant ¶ added in v0.1.2
IsConstant tells if the category is constant.
func (Category) IsContainerType ¶ added in v0.1.2
IsContainerType tells if the category is one of the container types.
func (Category) IsException ¶ added in v0.1.2
IsException tells if the category is exception.
func (Category) IsStructLike ¶ added in v0.1.2
IsStructLike tells if the category is a struct-like.
type ConstTypedValue ¶
type ConstTypedValue struct {
Double *float64 `thrift:"Double,1,optional" frugal:"1,optional,double" json:"Double,omitempty"`
Int *int64 `thrift:"Int,2,optional" frugal:"2,optional,i64" json:"Int,omitempty"`
Literal *string `thrift:"Literal,3,optional" frugal:"3,optional,string" json:"Literal,omitempty"`
Identifier *string `thrift:"Identifier,4,optional" frugal:"4,optional,string" json:"Identifier,omitempty"`
List []*ConstValue `thrift:"List,5,optional" frugal:"5,optional,list<ConstValue>" json:"List,omitempty"`
Map []*MapConstValue `thrift:"Map,6,optional" frugal:"6,optional,list<MapConstValue>" json:"Map,omitempty"`
}
var ConstValue_TypedValue_DEFAULT *ConstTypedValue
func NewConstTypedValue ¶
func NewConstTypedValue() *ConstTypedValue
func (*ConstTypedValue) BLength ¶ added in v0.4.2
func (p *ConstTypedValue) BLength() int
func (*ConstTypedValue) CountSetFieldsConstTypedValue ¶
func (p *ConstTypedValue) CountSetFieldsConstTypedValue() int
func (*ConstTypedValue) FastAppend ¶ added in v0.4.2
func (p *ConstTypedValue) FastAppend(b []byte) []byte
func (*ConstTypedValue) FastRead ¶ added in v0.4.2
func (p *ConstTypedValue) FastRead(b []byte) (off int, err error)
func (*ConstTypedValue) FastWrite ¶ added in v0.4.2
func (p *ConstTypedValue) FastWrite(b []byte) int
func (*ConstTypedValue) FastWriteNocopy ¶ added in v0.4.2
func (p *ConstTypedValue) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*ConstTypedValue) GetDouble ¶
func (p *ConstTypedValue) GetDouble() (v float64)
func (*ConstTypedValue) GetIdentifier ¶
func (p *ConstTypedValue) GetIdentifier() (v string)
func (*ConstTypedValue) GetInt ¶
func (p *ConstTypedValue) GetInt() (v int64)
func (*ConstTypedValue) GetList ¶
func (p *ConstTypedValue) GetList() (v []*ConstValue)
func (*ConstTypedValue) GetLiteral ¶
func (p *ConstTypedValue) GetLiteral() (v string)
func (*ConstTypedValue) GetMap ¶
func (p *ConstTypedValue) GetMap() (v []*MapConstValue)
func (*ConstTypedValue) InitDefault ¶ added in v0.4.2
func (p *ConstTypedValue) InitDefault()
func (*ConstTypedValue) IsSetDouble ¶
func (p *ConstTypedValue) IsSetDouble() bool
func (*ConstTypedValue) IsSetIdentifier ¶
func (p *ConstTypedValue) IsSetIdentifier() bool
func (*ConstTypedValue) IsSetInt ¶
func (p *ConstTypedValue) IsSetInt() bool
func (*ConstTypedValue) IsSetList ¶
func (p *ConstTypedValue) IsSetList() bool
func (*ConstTypedValue) IsSetLiteral ¶
func (p *ConstTypedValue) IsSetLiteral() bool
func (*ConstTypedValue) IsSetMap ¶
func (p *ConstTypedValue) IsSetMap() bool
func (*ConstTypedValue) String ¶
func (p *ConstTypedValue) String() string
type ConstValue ¶
type ConstValue struct {
Type ConstType `thrift:"Type,1" frugal:"1,default,ConstType" json:"Type"`
TypedValue *ConstTypedValue `thrift:"TypedValue,2,optional" frugal:"2,optional,ConstTypedValue" json:"TypedValue,omitempty"`
Extra *ConstValueExtra `thrift:"Extra,3,optional" frugal:"3,optional,ConstValueExtra" json:"Extra,omitempty"`
}
var Constant_Value_DEFAULT *ConstValue
var Field_Default_DEFAULT *ConstValue
var MapConstValue_Key_DEFAULT *ConstValue
var MapConstValue_Value_DEFAULT *ConstValue
func NewConstValue ¶
func NewConstValue() *ConstValue
func (*ConstValue) BLength ¶ added in v0.4.2
func (p *ConstValue) BLength() int
func (*ConstValue) FastAppend ¶ added in v0.4.2
func (p *ConstValue) FastAppend(b []byte) []byte
func (*ConstValue) FastRead ¶ added in v0.4.2
func (p *ConstValue) FastRead(b []byte) (off int, err error)
func (*ConstValue) FastWrite ¶ added in v0.4.2
func (p *ConstValue) FastWrite(b []byte) int
func (*ConstValue) FastWriteNocopy ¶ added in v0.4.2
func (p *ConstValue) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*ConstValue) GetExtra ¶ added in v0.1.2
func (p *ConstValue) GetExtra() (v *ConstValueExtra)
func (*ConstValue) GetType ¶
func (p *ConstValue) GetType() (v ConstType)
func (*ConstValue) GetTypedValue ¶
func (p *ConstValue) GetTypedValue() (v *ConstTypedValue)
func (*ConstValue) InitDefault ¶ added in v0.4.2
func (p *ConstValue) InitDefault()
func (*ConstValue) IsSetExtra ¶ added in v0.1.2
func (p *ConstValue) IsSetExtra() bool
func (*ConstValue) IsSetTypedValue ¶
func (p *ConstValue) IsSetTypedValue() bool
func (*ConstValue) String ¶
func (t *ConstValue) String() string
type ConstValueExtra ¶ added in v0.1.2
type ConstValueExtra struct {
IsEnum bool `thrift:"IsEnum,1" frugal:"1,default,bool" json:"IsEnum"`
Index int32 `thrift:"Index,2" frugal:"2,default,i32" json:"Index"`
Name string `thrift:"Name,3" frugal:"3,default,string" json:"Name"`
Sel string `thrift:"Sel,4" frugal:"4,default,string" json:"Sel"`
}
var ConstValue_Extra_DEFAULT *ConstValueExtra
func NewConstValueExtra ¶ added in v0.1.2
func NewConstValueExtra() *ConstValueExtra
func (*ConstValueExtra) BLength ¶ added in v0.4.2
func (p *ConstValueExtra) BLength() int
func (*ConstValueExtra) FastAppend ¶ added in v0.4.2
func (p *ConstValueExtra) FastAppend(b []byte) []byte
func (*ConstValueExtra) FastRead ¶ added in v0.4.2
func (p *ConstValueExtra) FastRead(b []byte) (off int, err error)
func (*ConstValueExtra) FastWrite ¶ added in v0.4.2
func (p *ConstValueExtra) FastWrite(b []byte) int
func (*ConstValueExtra) FastWriteNocopy ¶ added in v0.4.2
func (p *ConstValueExtra) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*ConstValueExtra) GetIndex ¶ added in v0.1.2
func (p *ConstValueExtra) GetIndex() (v int32)
func (*ConstValueExtra) GetIsEnum ¶ added in v0.1.2
func (p *ConstValueExtra) GetIsEnum() (v bool)
func (*ConstValueExtra) GetName ¶ added in v0.1.2
func (p *ConstValueExtra) GetName() (v string)
func (*ConstValueExtra) GetSel ¶ added in v0.1.2
func (p *ConstValueExtra) GetSel() (v string)
func (*ConstValueExtra) InitDefault ¶ added in v0.4.2
func (p *ConstValueExtra) InitDefault()
func (*ConstValueExtra) String ¶ added in v0.1.2
func (p *ConstValueExtra) String() string
type Constant ¶
type Constant struct {
Name string `thrift:"Name,1" frugal:"1,default,string" json:"Name"`
Type *Type `thrift:"Type,2,optional" frugal:"2,optional,Type" json:"Type,omitempty"`
Value *ConstValue `thrift:"Value,3,optional" frugal:"3,optional,ConstValue" json:"Value,omitempty"`
Annotations Annotations `thrift:"Annotations,4" frugal:"4,default,list<Annotation>" json:"Annotations"`
ReservedComments string `thrift:"ReservedComments,5" frugal:"5,default,string" json:"ReservedComments"`
}
func NewConstant ¶
func NewConstant() *Constant
func (*Constant) FastAppend ¶ added in v0.4.2
func (*Constant) FastWriteNocopy ¶ added in v0.4.2
func (p *Constant) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*Constant) GetAnnotations ¶
func (p *Constant) GetAnnotations() (v Annotations)
func (*Constant) GetReservedComments ¶ added in v0.1.3
func (*Constant) GetValue ¶
func (p *Constant) GetValue() (v *ConstValue)
func (*Constant) InitDefault ¶ added in v0.4.2
func (p *Constant) InitDefault()
func (*Constant) IsSetValue ¶
type Enum ¶
type Enum struct {
Name string `thrift:"Name,1" frugal:"1,default,string" json:"Name"`
Values []*EnumValue `thrift:"Values,2" frugal:"2,default,list<EnumValue>" json:"Values"`
Annotations Annotations `thrift:"Annotations,3" frugal:"3,default,list<Annotation>" json:"Annotations"`
ReservedComments string `thrift:"ReservedComments,4" frugal:"4,default,string" json:"ReservedComments"`
}
func (*Enum) FastAppend ¶ added in v0.4.2
func (*Enum) FastWriteNocopy ¶ added in v0.4.2
func (p *Enum) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*Enum) GetAnnotations ¶
func (p *Enum) GetAnnotations() (v Annotations)
func (*Enum) GetReservedComments ¶ added in v0.1.3
func (*Enum) InitDefault ¶ added in v0.4.2
func (p *Enum) InitDefault()
type EnumValue ¶
type EnumValue struct {
Name string `thrift:"Name,1" frugal:"1,default,string" json:"Name"`
Value int64 `thrift:"Value,2" frugal:"2,default,i64" json:"Value"`
Annotations Annotations `thrift:"Annotations,3" frugal:"3,default,list<Annotation>" json:"Annotations"`
ReservedComments string `thrift:"ReservedComments,4" frugal:"4,default,string" json:"ReservedComments"`
}
func NewEnumValue ¶
func NewEnumValue() *EnumValue
func (*EnumValue) FastAppend ¶ added in v0.4.2
func (*EnumValue) FastWriteNocopy ¶ added in v0.4.2
func (p *EnumValue) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*EnumValue) GetAnnotations ¶
func (p *EnumValue) GetAnnotations() (v Annotations)
func (*EnumValue) GetReservedComments ¶ added in v0.1.4
func (*EnumValue) InitDefault ¶ added in v0.4.2
func (p *EnumValue) InitDefault()
type Field ¶
type Field struct {
ID int32 `thrift:"ID,1" frugal:"1,default,i32" json:"ID"`
Name string `thrift:"Name,2" frugal:"2,default,string" json:"Name"`
Requiredness FieldType `thrift:"Requiredness,3" frugal:"3,default,FieldType" json:"Requiredness"`
Type *Type `thrift:"Type,4" frugal:"4,default,Type" json:"Type"`
Default *ConstValue `thrift:"Default,5,optional" frugal:"5,optional,ConstValue" json:"Default,omitempty"`
Annotations Annotations `thrift:"Annotations,6" frugal:"6,default,list<Annotation>" json:"Annotations"`
ReservedComments string `thrift:"ReservedComments,7" frugal:"7,default,string" json:"ReservedComments"`
}
func (*Field) FastAppend ¶ added in v0.4.2
func (*Field) FastWriteNocopy ¶ added in v0.4.2
func (p *Field) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*Field) GetAnnotations ¶
func (p *Field) GetAnnotations() (v Annotations)
func (*Field) GetDefault ¶
func (p *Field) GetDefault() (v *ConstValue)
func (*Field) GetRequiredness ¶
func (*Field) GetReservedComments ¶ added in v0.1.3
func (*Field) InitDefault ¶ added in v0.4.2
func (p *Field) InitDefault()
func (*Field) IsSetDefault ¶
type FieldType ¶
type FieldType int64
func FieldTypeFromString ¶
func FieldTypePtr ¶
func (FieldType) IsOptional ¶ added in v0.1.2
IsOptional tells whether a field type is optional.
func (FieldType) IsRequired ¶ added in v0.1.2
IsRequired tells whether a field type is required.
type Function ¶
type Function struct {
Name string `thrift:"Name,1" frugal:"1,default,string" json:"Name"`
Oneway bool `thrift:"Oneway,2" frugal:"2,default,bool" json:"Oneway"`
Void bool `thrift:"Void,3" frugal:"3,default,bool" json:"Void"`
FunctionType *Type `thrift:"FunctionType,4,optional" frugal:"4,optional,Type" json:"FunctionType,omitempty"`
Arguments []*Field `thrift:"Arguments,5" frugal:"5,default,list<Field>" json:"Arguments"`
Throws []*Field `thrift:"Throws,6" frugal:"6,default,list<Field>" json:"Throws"`
Annotations Annotations `thrift:"Annotations,7" frugal:"7,default,list<Annotation>" json:"Annotations"`
ReservedComments string `thrift:"ReservedComments,8" frugal:"8,default,string" json:"ReservedComments"`
}
func NewFunction ¶
func NewFunction() *Function
func (*Function) FastAppend ¶ added in v0.4.2
func (*Function) FastWriteNocopy ¶ added in v0.4.2
func (p *Function) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*Function) ForEachArgument ¶ added in v0.1.2
ForEachArgument calls f on each argument of the current function.
func (*Function) ForEachThrow ¶ added in v0.1.2
ForEachThrow calls f on each throw of the current function.
func (*Function) GetAnnotations ¶
func (p *Function) GetAnnotations() (v Annotations)
func (*Function) GetArguments ¶
func (*Function) GetFunctionType ¶
func (*Function) GetReservedComments ¶ added in v0.1.3
func (*Function) InitDefault ¶ added in v0.4.2
func (p *Function) InitDefault()
func (*Function) IsSetFunctionType ¶
type Include ¶
type Include struct {
Path string `thrift:"Path,1" frugal:"1,default,string" json:"Path"`
Reference *Thrift `thrift:"Reference,2,optional" frugal:"2,optional,Thrift" json:"Reference,omitempty"`
Used *bool `thrift:"Used,3,optional" frugal:"3,optional,bool" json:"Used,omitempty"`
}
func NewInclude ¶
func NewInclude() *Include
func (*Include) FastAppend ¶ added in v0.4.2
func (*Include) FastWriteNocopy ¶ added in v0.4.2
func (p *Include) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*Include) GetReference ¶
func (*Include) InitDefault ¶ added in v0.4.2
func (p *Include) InitDefault()
func (*Include) IsSetReference ¶
type MapConstValue ¶
type MapConstValue struct {
Key *ConstValue `thrift:"Key,1,optional" frugal:"1,optional,ConstValue" json:"Key,omitempty"`
Value *ConstValue `thrift:"Value,2,optional" frugal:"2,optional,ConstValue" json:"Value,omitempty"`
}
func NewMapConstValue ¶
func NewMapConstValue() *MapConstValue
func (*MapConstValue) BLength ¶ added in v0.4.2
func (p *MapConstValue) BLength() int
func (*MapConstValue) FastAppend ¶ added in v0.4.2
func (p *MapConstValue) FastAppend(b []byte) []byte
func (*MapConstValue) FastRead ¶ added in v0.4.2
func (p *MapConstValue) FastRead(b []byte) (off int, err error)
func (*MapConstValue) FastWrite ¶ added in v0.4.2
func (p *MapConstValue) FastWrite(b []byte) int
func (*MapConstValue) FastWriteNocopy ¶ added in v0.4.2
func (p *MapConstValue) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*MapConstValue) GetKey ¶
func (p *MapConstValue) GetKey() (v *ConstValue)
func (*MapConstValue) GetValue ¶
func (p *MapConstValue) GetValue() (v *ConstValue)
func (*MapConstValue) InitDefault ¶ added in v0.4.2
func (p *MapConstValue) InitDefault()
func (*MapConstValue) IsSetKey ¶
func (p *MapConstValue) IsSetKey() bool
func (*MapConstValue) IsSetValue ¶
func (p *MapConstValue) IsSetValue() bool
func (*MapConstValue) String ¶
func (p *MapConstValue) String() string
type Namespace ¶
type Namespace struct {
Language string `thrift:"Language,1" frugal:"1,default,string" json:"Language"`
Name string `thrift:"Name,2" frugal:"2,default,string" json:"Name"`
Annotations Annotations `thrift:"Annotations,3" frugal:"3,default,list<Annotation>" json:"Annotations"`
}
func NewNamespace ¶
func NewNamespace() *Namespace
func (*Namespace) FastAppend ¶ added in v0.4.2
func (*Namespace) FastWriteNocopy ¶ added in v0.4.2
func (p *Namespace) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*Namespace) GetAnnotations ¶
func (p *Namespace) GetAnnotations() (v Annotations)
func (*Namespace) GetLanguage ¶
func (*Namespace) InitDefault ¶ added in v0.4.2
func (p *Namespace) InitDefault()
type Reference ¶ added in v0.1.2
type Reference struct {
Name string `thrift:"Name,1" frugal:"1,default,string" json:"Name"`
Index int32 `thrift:"Index,2" frugal:"2,default,i32" json:"Index"`
}
var Service_Reference_DEFAULT *Reference
var Type_Reference_DEFAULT *Reference
func NewReference ¶ added in v0.1.2
func NewReference() *Reference
func (*Reference) FastAppend ¶ added in v0.4.2
func (*Reference) FastWriteNocopy ¶ added in v0.4.2
func (p *Reference) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*Reference) InitDefault ¶ added in v0.4.2
func (p *Reference) InitDefault()
type Service ¶
type Service struct {
Name string `thrift:"Name,1" frugal:"1,default,string" json:"Name"`
Extends string `thrift:"Extends,2" frugal:"2,default,string" json:"Extends"`
Functions []*Function `thrift:"Functions,3" frugal:"3,default,list<Function>" json:"Functions"`
Annotations Annotations `thrift:"Annotations,4" frugal:"4,default,list<Annotation>" json:"Annotations"`
Reference *Reference `thrift:"Reference,5,optional" frugal:"5,optional,Reference" json:"Reference,omitempty"`
ReservedComments string `thrift:"ReservedComments,6" frugal:"6,default,string" json:"ReservedComments"`
}
func NewService ¶
func NewService() *Service
func (*Service) FastAppend ¶ added in v0.4.2
func (*Service) FastWriteNocopy ¶ added in v0.4.2
func (p *Service) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*Service) ForEachFunction ¶ added in v0.1.2
ForEachFunction calls f on each function in the current service.
func (*Service) GetAnnotations ¶
func (p *Service) GetAnnotations() (v Annotations)
func (*Service) GetExtends ¶
func (*Service) GetFunctions ¶
func (*Service) GetReference ¶ added in v0.1.2
func (*Service) GetReservedComments ¶ added in v0.1.3
func (*Service) InitDefault ¶ added in v0.4.2
func (p *Service) InitDefault()
func (*Service) IsSetReference ¶ added in v0.1.2
type StructLike ¶
type StructLike struct {
Category string `thrift:"Category,1" frugal:"1,default,string" json:"Category"`
Name string `thrift:"Name,2" frugal:"2,default,string" json:"Name"`
Fields []*Field `thrift:"Fields,3" frugal:"3,default,list<Field>" json:"Fields"`
Annotations Annotations `thrift:"Annotations,4" frugal:"4,default,list<Annotation>" json:"Annotations"`
ReservedComments string `thrift:"ReservedComments,5" frugal:"5,default,string" json:"ReservedComments"`
}
func NewStructLike ¶
func NewStructLike() *StructLike
func (*StructLike) BLength ¶ added in v0.4.2
func (p *StructLike) BLength() int
func (*StructLike) FastAppend ¶ added in v0.4.2
func (p *StructLike) FastAppend(b []byte) []byte
func (*StructLike) FastRead ¶ added in v0.4.2
func (p *StructLike) FastRead(b []byte) (off int, err error)
func (*StructLike) FastWrite ¶ added in v0.4.2
func (p *StructLike) FastWrite(b []byte) int
func (*StructLike) FastWriteNocopy ¶ added in v0.4.2
func (p *StructLike) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*StructLike) ForEachField ¶ added in v0.1.2
func (s *StructLike) ForEachField(f func(v *Field) bool)
ForEachField calls f on each field of the current struct-like.
func (*StructLike) GetAnnotations ¶
func (p *StructLike) GetAnnotations() (v Annotations)
func (*StructLike) GetCategory ¶
func (p *StructLike) GetCategory() (v string)
func (*StructLike) GetField ¶
func (s *StructLike) GetField(name string) (*Field, bool)
GetField returns a field of the struct-like that matches the name.
func (*StructLike) GetFields ¶
func (p *StructLike) GetFields() (v []*Field)
func (*StructLike) GetName ¶
func (p *StructLike) GetName() (v string)
func (*StructLike) GetReservedComments ¶ added in v0.1.3
func (p *StructLike) GetReservedComments() (v string)
func (*StructLike) InitDefault ¶ added in v0.4.2
func (p *StructLike) InitDefault()
func (*StructLike) String ¶
func (p *StructLike) String() string
type Thrift ¶
type Thrift struct {
Filename string `thrift:"Filename,1" frugal:"1,default,string" json:"Filename"`
Includes []*Include `thrift:"Includes,2" frugal:"2,default,list<Include>" json:"Includes"`
CppIncludes []string `thrift:"CppIncludes,3" frugal:"3,default,list<string>" json:"CppIncludes"`
Namespaces []*Namespace `thrift:"Namespaces,4" frugal:"4,default,list<Namespace>" json:"Namespaces"`
Typedefs []*Typedef `thrift:"Typedefs,5" frugal:"5,default,list<Typedef>" json:"Typedefs"`
Constants []*Constant `thrift:"Constants,6" frugal:"6,default,list<Constant>" json:"Constants"`
Enums []*Enum `thrift:"Enums,7" frugal:"7,default,list<Enum>" json:"Enums"`
Structs []*StructLike `thrift:"Structs,8" frugal:"8,default,list<StructLike>" json:"Structs"`
Unions []*StructLike `thrift:"Unions,9" frugal:"9,default,list<StructLike>" json:"Unions"`
Exceptions []*StructLike `thrift:"Exceptions,10" frugal:"10,default,list<StructLike>" json:"Exceptions"`
Services []*Service `thrift:"Services,11" frugal:"11,default,list<Service>" json:"Services"`
Name2Category map[string]Category `thrift:"Name2Category,12" frugal:"12,default,map<string:Category>" json:"Name2Category"`
}
var Include_Reference_DEFAULT *Thrift
func ParseBatchString ¶ added in v0.3.14
func ParseBatchString(mainIDLFilePath string, IDLFileContentMap map[string]string, includeDirs []string) (*Thrift, error)
ParseBatchString parses a group of string content and returns an AST. IDLContent is a map, which's key is IDLPath and value is IDL content.
func ParseFile ¶
ParseFile parses a thrift file and returns an AST. If recursive is true, then the include IDLs are parsed recursively as well.
func ParseString ¶
ParseString parses the thrift file path and file content then return an AST.
func (*Thrift) DepthFirstSearch ¶
DepthFirstSearch returns a channal providing Thrift ASTs in a depth-first order without duplication. Unparsed references will be ignored.
func (*Thrift) FastAppend ¶ added in v0.4.2
func (*Thrift) FastWriteNocopy ¶ added in v0.4.2
func (p *Thrift) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*Thrift) ForEachConstant ¶ added in v0.1.2
ForEachConstant calls f on each constant in the current AST.
func (*Thrift) ForEachEnum ¶ added in v0.1.2
ForEachEnum calls f on each enum in the current AST.
func (*Thrift) ForEachException ¶ added in v0.1.2
func (t *Thrift) ForEachException(f func(v *StructLike) bool)
ForEachException calls f on each exception in the current AST.
func (*Thrift) ForEachInclude ¶ added in v0.1.2
ForEachInclude calls f on each include of the current AST.
func (*Thrift) ForEachNamepace ¶ added in v0.1.2
ForEachNamepace calls f on each namespace of the current AST.
func (*Thrift) ForEachService ¶ added in v0.1.2
ForEachService calls f on each service in the current AST.
func (*Thrift) ForEachStruct ¶ added in v0.1.2
func (t *Thrift) ForEachStruct(f func(v *StructLike) bool)
ForEachStruct calls f on each struct in the current AST.
func (*Thrift) ForEachStructLike ¶ added in v0.1.2
func (t *Thrift) ForEachStructLike(f func(v *StructLike) bool)
ForEachStructLike calls f on each struct-like in the current AST.
func (*Thrift) ForEachTypedef ¶ added in v0.1.2
ForEachTypedef calls f on each typedef in the current AST.
func (*Thrift) ForEachUnion ¶ added in v0.1.2
func (t *Thrift) ForEachUnion(f func(v *StructLike) bool)
ForEachUnion calls f on each union in the current AST.
func (*Thrift) GetConstant ¶
GetConstant returns a Constant node that mathces the name.
func (*Thrift) GetConstants ¶
func (*Thrift) GetCppIncludes ¶
func (*Thrift) GetException ¶
func (t *Thrift) GetException(name string) (*StructLike, bool)
GetException returns an Exception that matches the name.
func (*Thrift) GetExceptions ¶
func (p *Thrift) GetExceptions() (v []*StructLike)
func (*Thrift) GetFilename ¶
func (*Thrift) GetIncludes ¶
func (*Thrift) GetName2Category ¶ added in v0.1.2
func (*Thrift) GetNamespace ¶
GetNamespace returns a namespace for the language. When both "*" and the language have a namespace defined, the latter is preferred.
func (*Thrift) GetNamespaceOrReferenceName ¶
GetNamespaceOrReferenceName returns a namespace for the language. If the namespace is not defined, then the base name without extension of the IDL will be returned.
func (*Thrift) GetNamespaces ¶
func (*Thrift) GetReference ¶
GetReference return a AST that matches the given name. References should be initialized before calling this method.
func (*Thrift) GetService ¶
GetService returns a Service node that matches the name.
func (*Thrift) GetServices ¶
func (*Thrift) GetStruct ¶
func (t *Thrift) GetStruct(name string) (*StructLike, bool)
GetStruct returns a Struct node that matches the name.
func (*Thrift) GetStructLikes ¶ added in v0.1.2
func (t *Thrift) GetStructLikes() (ss []*StructLike)
GetStructLikes returns all struct-like definitions in the AST.
func (*Thrift) GetStructs ¶
func (p *Thrift) GetStructs() (v []*StructLike)
func (*Thrift) GetTypedef ¶
GetTypedef returns a Typedef node that matches the alias name.
func (*Thrift) GetTypedefs ¶
func (*Thrift) GetUnion ¶
func (t *Thrift) GetUnion(name string) (*StructLike, bool)
GetUnion returns a Union node that matches the name.
func (*Thrift) GetUnions ¶
func (p *Thrift) GetUnions() (v []*StructLike)
func (*Thrift) InitDefault ¶ added in v0.4.2
func (p *Thrift) InitDefault()
type ThriftIDL ¶
func (*ThriftIDL) PrettyPrintSyntaxTree ¶ added in v0.1.3
func (t *ThriftIDL) PrettyPrintSyntaxTree(buffer string)
func (*ThriftIDL) PrintSyntaxTree ¶
func (p *ThriftIDL) PrintSyntaxTree()
func (*ThriftIDL) SprintSyntaxTree ¶ added in v0.1.3
func (*ThriftIDL) WriteSyntaxTree ¶ added in v0.1.3
type Type ¶
type Type struct {
Name string `thrift:"Name,1" frugal:"1,default,string" json:"Name"`
KeyType *Type `thrift:"KeyType,2,optional" frugal:"2,optional,Type" json:"KeyType,omitempty"`
ValueType *Type `thrift:"ValueType,3,optional" frugal:"3,optional,Type" json:"ValueType,omitempty"`
CppType string `thrift:"CppType,4" frugal:"4,default,string" json:"CppType"`
Annotations Annotations `thrift:"Annotations,5" frugal:"5,default,list<Annotation>" json:"Annotations"`
Category Category `thrift:"Category,6" frugal:"6,default,Category" json:"Category"`
Reference *Reference `thrift:"Reference,7,optional" frugal:"7,optional,Reference" json:"Reference,omitempty"`
IsTypedef *bool `thrift:"IsTypedef,8,optional" frugal:"8,optional,bool" json:"IsTypedef,omitempty"`
}
var Constant_Type_DEFAULT *Type
var Field_Type_DEFAULT *Type
var Function_FunctionType_DEFAULT *Type
var Type_KeyType_DEFAULT *Type
var Type_ValueType_DEFAULT *Type
var Typedef_Type_DEFAULT *Type
func (*Type) FastAppend ¶ added in v0.4.2
func (*Type) FastWriteNocopy ¶ added in v0.4.2
func (p *Type) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*Type) GetAnnotations ¶
func (p *Type) GetAnnotations() (v Annotations)
func (*Type) GetCategory ¶ added in v0.1.2
func (*Type) GetCppType ¶
func (*Type) GetIsTypedef ¶ added in v0.1.2
func (*Type) GetKeyType ¶
func (*Type) GetReference ¶ added in v0.1.2
func (*Type) GetValueType ¶
func (*Type) InitDefault ¶ added in v0.4.2
func (p *Type) InitDefault()
func (*Type) IsSetIsTypedef ¶ added in v0.1.2
func (*Type) IsSetKeyType ¶
func (*Type) IsSetReference ¶ added in v0.1.2
func (*Type) IsSetValueType ¶
type Typedef ¶
type Typedef struct {
Type *Type `thrift:"Type,1,optional" frugal:"1,optional,Type" json:"Type,omitempty"`
Alias string `thrift:"Alias,2" frugal:"2,default,string" json:"Alias"`
Annotations Annotations `thrift:"Annotations,3" frugal:"3,default,list<Annotation>" json:"Annotations"`
ReservedComments string `thrift:"ReservedComments,4" frugal:"4,default,string" json:"ReservedComments"`
}
func NewTypedef ¶
func NewTypedef() *Typedef
func (*Typedef) FastAppend ¶ added in v0.4.2
func (*Typedef) FastWriteNocopy ¶ added in v0.4.2
func (p *Typedef) FastWriteNocopy(b []byte, w thrift.NocopyWriter) (n int)
func (*Typedef) GetAnnotations ¶
func (p *Typedef) GetAnnotations() (v Annotations)
func (*Typedef) GetReservedComments ¶ added in v0.1.3
func (*Typedef) InitDefault ¶ added in v0.4.2
func (p *Typedef) InitDefault()