Versions in this module Expand all Collapse all v0 v0.3.18 Sep 20, 2024 Changes in this version + const BINARY + const BOOL + const BYTE + const DOUBLE + const I08 + const I16 + const I32 + const I64 + const LIST + const MAP + const NOTSET + const SET + const STOP + const STRING + const STRUCT + const UNKNOWN + const UTF16 + const UTF7 + const UTF8 + const VOID + 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 Type_IsTypedef_DEFAULT bool + 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 struct + Key string + Values []string + func NewAnnotation() *Annotation + func (p *Annotation) GetKey() (v string) + func (p *Annotation) GetValues() (v []string) + func (p *Annotation) String() string + type Annotations []*Annotation + func (a *Annotations) Append(key, value string) + func (a *Annotations) Get(key string) []string + func (a *Annotations) ILocValueByKey(key string, idx int) string + type Category int64 + const Category_Binary + const Category_Bool + const Category_Byte + const Category_Constant + const Category_Double + const Category_Enum + const Category_Exception + const Category_I16 + const Category_I32 + const Category_I64 + const Category_List + const Category_Map + const Category_Service + const Category_Set + const Category_String + const Category_Struct + const Category_Typedef + const Category_Union + func CategoryFromString(s string) (Category, error) + func CategoryPtr(v Category) *Category + func (p *Category) Scan(value interface{}) (err error) + func (p *Category) Value() (driver.Value, error) + 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) String() string + type ConstType int64 + const ConstType_ConstDouble + const ConstType_ConstIdentifier + const ConstType_ConstInt + const ConstType_ConstList + const ConstType_ConstLiteral + const ConstType_ConstMap + func ConstTypeFromString(s string) (ConstType, error) + func ConstTypePtr(v ConstType) *ConstType + func (p *ConstType) Scan(value interface{}) (err error) + func (p *ConstType) Value() (driver.Value, error) + func (p ConstType) String() string + type ConstTypedValue struct + Double *float64 + Identifier *string + Int *int64 + List []*ConstValue + Literal *string + Map []*MapConstValue + var ConstValue_TypedValue_DEFAULT *ConstTypedValue + func NewConstTypedValue() *ConstTypedValue + func (p *ConstTypedValue) CountSetFieldsConstTypedValue() 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) 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 struct + Extra *ConstValueExtra + Type ConstType + TypedValue *ConstTypedValue + var Constant_Value_DEFAULT *ConstValue + var Field_Default_DEFAULT *ConstValue + var MapConstValue_Key_DEFAULT *ConstValue + var MapConstValue_Value_DEFAULT *ConstValue + func NewConstValue() *ConstValue + func (p *ConstValue) GetExtra() (v *ConstValueExtra) + func (p *ConstValue) GetType() (v ConstType) + func (p *ConstValue) GetTypedValue() (v *ConstTypedValue) + func (p *ConstValue) IsSetExtra() bool + func (p *ConstValue) IsSetTypedValue() bool + func (t *ConstValue) String() string + type ConstValueExtra struct + Index int32 + IsEnum bool + Name string + Sel string + var ConstValue_Extra_DEFAULT *ConstValueExtra + func NewConstValueExtra() *ConstValueExtra + 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) String() string + type Constant struct + Annotations Annotations + Name string + ReservedComments string + Type *Type + Value *ConstValue + func NewConstant() *Constant + 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) IsSetType() bool + func (p *Constant) IsSetValue() bool + func (p *Constant) String() string + type Enum struct + Annotations Annotations + Name string + ReservedComments string + Values []*EnumValue + func NewEnum() *Enum + 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) String() string + type EnumValue struct + Annotations Annotations + Name string + ReservedComments string + Value int64 + func NewEnumValue() *EnumValue + 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) String() string + type Field struct + Annotations Annotations + Default *ConstValue + ID int32 + Name string + Requiredness FieldType + ReservedComments string + Type *Type + func NewField() *Field + 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) IsSetDefault() bool + func (p *Field) IsSetType() bool + func (p *Field) String() string + type FieldType int64 + const FieldType_Default + const FieldType_Optional + const FieldType_Required + func FieldTypeFromString(s string) (FieldType, error) + func FieldTypePtr(v FieldType) *FieldType + func (p *FieldType) Scan(value interface{}) (err error) + func (p *FieldType) Value() (driver.Value, error) + func (p FieldType) String() string + func (r FieldType) IsDefault() bool + func (r FieldType) IsOptional() bool + func (r FieldType) IsRequired() bool + type Function struct + Annotations Annotations + Arguments []*Field + FunctionType *Type + Name string + Oneway bool + ReservedComments string + Throws []*Field + Void bool + func NewFunction() *Function + 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) IsSetFunctionType() bool + func (p *Function) String() string + type Include struct + Path string + Reference *Thrift + Used *bool + func NewInclude() *Include + func (p *Include) GetPath() (v string) + func (p *Include) GetReference() (v *Thrift) + func (p *Include) GetUsed() (v bool) + func (p *Include) IsSetReference() bool + func (p *Include) IsSetUsed() bool + func (p *Include) String() string + type MapConstValue struct + Key *ConstValue + Value *ConstValue + func NewMapConstValue() *MapConstValue + func (p *MapConstValue) GetKey() (v *ConstValue) + func (p *MapConstValue) GetValue() (v *ConstValue) + func (p *MapConstValue) IsSetKey() bool + func (p *MapConstValue) IsSetValue() bool + func (p *MapConstValue) String() string + type Namespace struct + Annotations Annotations + Language string + Name string + func NewNamespace() *Namespace + func (p *Namespace) GetAnnotations() (v Annotations) + func (p *Namespace) GetLanguage() (v string) + func (p *Namespace) GetName() (v string) + func (p *Namespace) String() string + type Reference struct + Index int32 + Name string + var Service_Reference_DEFAULT *Reference + var Type_Reference_DEFAULT *Reference + func NewReference() *Reference + func (p *Reference) GetIndex() (v int32) + func (p *Reference) GetName() (v string) + func (p *Reference) String() string + type Service struct + Annotations Annotations + Extends string + Functions []*Function + Name string + Reference *Reference + ReservedComments string + func NewService() *Service + 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) IsSetReference() bool + func (p *Service) String() string + func (s *Service) ForEachFunction(f func(v *Function) bool) + type StructLike struct + Annotations Annotations + Category string + Fields []*Field + Name string + ReservedComments string + func NewStructLike() *StructLike + func (p *StructLike) GetAnnotations() (v Annotations) + func (p *StructLike) GetCategory() (v string) + func (p *StructLike) GetFields() (v []*Field) + func (p *StructLike) GetName() (v string) + func (p *StructLike) GetReservedComments() (v string) + func (p *StructLike) String() string + func (s *StructLike) ForEachField(f func(v *Field) bool) + func (s *StructLike) GetField(name string) (*Field, bool) + type Thrift struct + Constants []*Constant + CppIncludes []string + Enums []*Enum + Exceptions []*StructLike + Filename string + Includes []*Include + Name2Category map[string]Category + Namespaces []*Namespace + Services []*Service + Structs []*StructLike + Typedefs []*Typedef + Unions []*StructLike + var Include_Reference_DEFAULT *Thrift + func NewThrift() *Thrift + func ParseBatchString(mainIDLFilePath string, IDLFileContentMap map[string]string, ...) (*Thrift, error) + func ParseFile(path string, includeDirs []string, recursive bool) (*Thrift, error) + func ParseString(path, content string) (*Thrift, error) + func (p *Thrift) GetConstants() (v []*Constant) + func (p *Thrift) GetCppIncludes() (v []string) + func (p *Thrift) GetEnums() (v []*Enum) + 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 (p *Thrift) GetNamespaces() (v []*Namespace) + func (p *Thrift) GetServices() (v []*Service) + func (p *Thrift) GetStructs() (v []*StructLike) + func (p *Thrift) GetTypedefs() (v []*Typedef) + func (p *Thrift) GetUnions() (v []*StructLike) + func (p *Thrift) String() string + func (t *Thrift) DepthFirstSearch() chan *Thrift + 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 (t *Thrift) GetEnum(name string) (*Enum, bool) + func (t *Thrift) GetException(name string) (*StructLike, bool) + func (t *Thrift) GetNamespace(lang string) (ns string, found bool) + func (t *Thrift) GetNamespaceOrReferenceName(lang string) string + func (t *Thrift) GetReference(refname string) (*Thrift, bool) + func (t *Thrift) GetService(name string) (*Service, bool) + func (t *Thrift) GetStruct(name string) (*StructLike, bool) + func (t *Thrift) GetStructLikes() (ss []*StructLike) + func (t *Thrift) GetTypedef(alias string) (*Typedef, bool) + func (t *Thrift) GetUnion(name string) (*StructLike, bool) + type ThriftIDL struct + Buffer string + Pretty bool + func (p *ThriftIDL) Init(options ...func(*ThriftIDL) error) error + func (p *ThriftIDL) Parse(rule ...int) error + func (p *ThriftIDL) PrintSyntaxTree() + func (p *ThriftIDL) Reset() + func (p *ThriftIDL) SprintSyntaxTree() string + func (p *ThriftIDL) WriteSyntaxTree(w io.Writer) + func (t *ThriftIDL) AST() *node32 + func (t *ThriftIDL) Add(rule pegRule, begin, end, index uint32) + func (t *ThriftIDL) PrettyPrintSyntaxTree(buffer string) + func (t *ThriftIDL) Print() + func (t *ThriftIDL) Tokens() []token32 + func (t *ThriftIDL) Trim(length uint32) + type Type struct + Annotations Annotations + Category Category + CppType string + IsTypedef *bool + KeyType *Type + Name string + Reference *Reference + ValueType *Type + 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 NewType() *Type + 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) IsSetIsTypedef() bool + func (p *Type) IsSetKeyType() bool + func (p *Type) IsSetReference() bool + func (p *Type) IsSetValueType() bool + func (t *Type) String() string + type Typedef struct + Alias string + Annotations Annotations + ReservedComments string + Type *Type + func NewTypedef() *Typedef + 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) IsSetType() bool + func (p *Typedef) String() string