thrift_reflection

package
v0.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 15 Imported by: 14 modules, 21 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DEFAULT_GLOBAL_DESCRIPTOR_UUID = "default"
	GLOBAL_UUID_EXTRA_KEY          = "global_descriptor_uuid"
)

Variables

View Source
var ConstDescriptor_Extra_DEFAULT map[string]string
View Source
var ConstValueDescriptor_Extra_DEFAULT map[string]string
View Source
var ConstValueDescriptor_ValueList_DEFAULT []*ConstValueDescriptor
View Source
var ConstValueDescriptor_ValueMap_DEFAULT map[*ConstValueDescriptor]*ConstValueDescriptor
View Source
var EnumDescriptor_Extra_DEFAULT map[string]string
View Source
var EnumValueDescriptor_Extra_DEFAULT map[string]string
View Source
var FieldDescriptor_Extra_DEFAULT map[string]string
View Source
var FileDescriptor_Extra_DEFAULT map[string]string
View Source
var MethodDescriptor_Extra_DEFAULT map[string]string
View Source
var ServiceDescriptor_Base_DEFAULT string = ""
View Source
var ServiceDescriptor_Extra_DEFAULT map[string]string
View Source
var StructDescriptor_Extra_DEFAULT map[string]string
View Source
var TypeDescriptor_Extra_DEFAULT map[string]string
View Source
var TypedefDescriptor_Extra_DEFAULT map[string]string

Functions

func RegisterAST

func RegisterAST(ast *parser.Thrift) (*GlobalDescriptor, *FileDescriptor)

func ReleaseGlobalDescriptors added in v0.3.19

func ReleaseGlobalDescriptors(gds ...*GlobalDescriptor)

ReleaseGlobalDescriptors release the global descriptor

Types

type ConstDescriptor

type ConstDescriptor struct {
	Filepath    string                `thrift:"filepath,1,required" json:"filepath"`
	Name        string                `thrift:"name,2,required" json:"name"`
	Type        *TypeDescriptor       `thrift:"type,3,required" json:"type"`
	Value       *ConstValueDescriptor `thrift:"value,4,required" json:"value"`
	Annotations map[string][]string   `thrift:"annotations,5,required" json:"annotations"`
	Comments    string                `thrift:"comments,6,required" json:"comments"`
	Extra       map[string]string     `thrift:"extra,7,optional" json:"extra,omitempty"`
}

func LookupConst

func LookupConst(name, filepath string) *ConstDescriptor

func NewConstDescriptor

func NewConstDescriptor() *ConstDescriptor

func (*ConstDescriptor) GetAnnotations

func (p *ConstDescriptor) GetAnnotations() (v map[string][]string)

func (*ConstDescriptor) GetComments

func (p *ConstDescriptor) GetComments() (v string)

func (*ConstDescriptor) GetExtra

func (p *ConstDescriptor) GetExtra() (v map[string]string)

func (*ConstDescriptor) GetFilepath

func (p *ConstDescriptor) GetFilepath() (v string)

func (*ConstDescriptor) GetName

func (p *ConstDescriptor) GetName() (v string)

func (*ConstDescriptor) GetType

func (p *ConstDescriptor) GetType() (v *TypeDescriptor)

func (*ConstDescriptor) GetValue

func (p *ConstDescriptor) GetValue() (v *ConstValueDescriptor)

func (*ConstDescriptor) InitDefault added in v0.3.16

func (p *ConstDescriptor) InitDefault()

func (*ConstDescriptor) IsSetExtra

func (p *ConstDescriptor) IsSetExtra() bool

func (*ConstDescriptor) IsSetType

func (p *ConstDescriptor) IsSetType() bool

func (*ConstDescriptor) IsSetValue

func (p *ConstDescriptor) IsSetValue() bool

func (*ConstDescriptor) String

func (p *ConstDescriptor) String() string

type ConstValueDescriptor

type ConstValueDescriptor struct {
	Type            ConstValueType                                  `thrift:"type,1,required" json:"type"`
	ValueDouble     float64                                         `thrift:"value_double,2,required" json:"value_double"`
	ValueInt        int64                                           `thrift:"value_int,3,required" json:"value_int"`
	ValueString     string                                          `thrift:"value_string,4,required" json:"value_string"`
	ValueBool       bool                                            `thrift:"value_bool,5,required" json:"value_bool"`
	ValueList       []*ConstValueDescriptor                         `thrift:"value_list,6,optional" json:"value_list,omitempty"`
	ValueMap        map[*ConstValueDescriptor]*ConstValueDescriptor `thrift:"value_map,7,optional" json:"value_map,omitempty"`
	ValueIdentifier string                                          `thrift:"value_identifier,8,required" json:"value_identifier"`
	Extra           map[string]string                               `thrift:"extra,9,optional" json:"extra,omitempty"`
}
var ConstDescriptor_Value_DEFAULT *ConstValueDescriptor
var FieldDescriptor_DefaultValue_DEFAULT *ConstValueDescriptor

func NewConstValueDescriptor

func NewConstValueDescriptor() *ConstValueDescriptor

func (*ConstValueDescriptor) GetExtra added in v0.3.8

func (p *ConstValueDescriptor) GetExtra() (v map[string]string)

func (*ConstValueDescriptor) GetType

func (p *ConstValueDescriptor) GetType() (v ConstValueType)

func (*ConstValueDescriptor) GetValueAsString

func (s *ConstValueDescriptor) GetValueAsString() string

func (*ConstValueDescriptor) GetValueBool

func (p *ConstValueDescriptor) GetValueBool() (v bool)

func (*ConstValueDescriptor) GetValueDouble

func (p *ConstValueDescriptor) GetValueDouble() (v float64)

func (*ConstValueDescriptor) GetValueIdentifier

func (p *ConstValueDescriptor) GetValueIdentifier() (v string)

func (*ConstValueDescriptor) GetValueInt

func (p *ConstValueDescriptor) GetValueInt() (v int64)

func (*ConstValueDescriptor) GetValueList

func (p *ConstValueDescriptor) GetValueList() (v []*ConstValueDescriptor)

func (*ConstValueDescriptor) GetValueMap

func (*ConstValueDescriptor) GetValueString

func (p *ConstValueDescriptor) GetValueString() (v string)

func (*ConstValueDescriptor) InitDefault added in v0.3.16

func (p *ConstValueDescriptor) InitDefault()

func (*ConstValueDescriptor) IsSetExtra added in v0.3.8

func (p *ConstValueDescriptor) IsSetExtra() bool

func (*ConstValueDescriptor) IsSetValueList

func (p *ConstValueDescriptor) IsSetValueList() bool

func (*ConstValueDescriptor) IsSetValueMap

func (p *ConstValueDescriptor) IsSetValueMap() bool

func (*ConstValueDescriptor) String

func (p *ConstValueDescriptor) String() string

type ConstValueType

type ConstValueType int64
const (
	ConstValueType_DOUBLE     ConstValueType = 0
	ConstValueType_INT        ConstValueType = 1
	ConstValueType_STRING     ConstValueType = 2
	ConstValueType_BOOL       ConstValueType = 3
	ConstValueType_LIST       ConstValueType = 4
	ConstValueType_MAP        ConstValueType = 5
	ConstValueType_IDENTIFIER ConstValueType = 6
)

func ConstValueTypeFromString

func ConstValueTypeFromString(s string) (ConstValueType, error)

func ConstValueTypePtr

func ConstValueTypePtr(v ConstValueType) *ConstValueType

func (*ConstValueType) Scan

func (p *ConstValueType) Scan(value interface{}) (err error)

func (ConstValueType) String

func (p ConstValueType) String() string

func (*ConstValueType) Value

func (p *ConstValueType) Value() (driver.Value, error)

type EnumDescriptor

type EnumDescriptor struct {
	Filepath    string                 `thrift:"filepath,1,required" json:"filepath"`
	Name        string                 `thrift:"name,2,required" json:"name"`
	Values      []*EnumValueDescriptor `thrift:"values,3,required" json:"values"`
	Annotations map[string][]string    `thrift:"annotations,4,required" json:"annotations"`
	Comments    string                 `thrift:"comments,5,required" json:"comments"`
	Extra       map[string]string      `thrift:"extra,6,optional" json:"extra,omitempty"`
}

func GetEnumDescriptorByGoType

func GetEnumDescriptorByGoType(in interface{}) *EnumDescriptor

func LookupEnum

func LookupEnum(name, filepath string) *EnumDescriptor

func NewEnumDescriptor

func NewEnumDescriptor() *EnumDescriptor

func (*EnumDescriptor) GetAnnotations

func (p *EnumDescriptor) GetAnnotations() (v map[string][]string)

func (*EnumDescriptor) GetComments

func (p *EnumDescriptor) GetComments() (v string)

func (*EnumDescriptor) GetExtra

func (p *EnumDescriptor) GetExtra() (v map[string]string)

func (*EnumDescriptor) GetFilepath

func (p *EnumDescriptor) GetFilepath() (v string)

func (*EnumDescriptor) GetGoType

func (ed *EnumDescriptor) GetGoType() reflect.Type

func (*EnumDescriptor) GetName

func (p *EnumDescriptor) GetName() (v string)

func (*EnumDescriptor) GetValues

func (p *EnumDescriptor) GetValues() (v []*EnumValueDescriptor)

func (*EnumDescriptor) InitDefault added in v0.3.16

func (p *EnumDescriptor) InitDefault()

func (*EnumDescriptor) IsSetExtra

func (p *EnumDescriptor) IsSetExtra() bool

func (*EnumDescriptor) String

func (p *EnumDescriptor) String() string

type EnumValueDescriptor

type EnumValueDescriptor struct {
	Filepath    string              `thrift:"filepath,1,required" json:"filepath"`
	Name        string              `thrift:"name,2,required" json:"name"`
	Value       int64               `thrift:"value,3,required" json:"value"`
	Annotations map[string][]string `thrift:"annotations,4,required" json:"annotations"`
	Comments    string              `thrift:"comments,5,required" json:"comments"`
	Extra       map[string]string   `thrift:"extra,6,optional" json:"extra,omitempty"`
}

func NewEnumValueDescriptor

func NewEnumValueDescriptor() *EnumValueDescriptor

func (*EnumValueDescriptor) GetAnnotations

func (p *EnumValueDescriptor) GetAnnotations() (v map[string][]string)

func (*EnumValueDescriptor) GetComments

func (p *EnumValueDescriptor) GetComments() (v string)

func (*EnumValueDescriptor) GetExtra

func (p *EnumValueDescriptor) GetExtra() (v map[string]string)

func (*EnumValueDescriptor) GetFilepath

func (p *EnumValueDescriptor) GetFilepath() (v string)

func (*EnumValueDescriptor) GetName

func (p *EnumValueDescriptor) GetName() (v string)

func (*EnumValueDescriptor) GetValue

func (p *EnumValueDescriptor) GetValue() (v int64)

func (*EnumValueDescriptor) InitDefault added in v0.3.16

func (p *EnumValueDescriptor) InitDefault()

func (*EnumValueDescriptor) IsSetExtra

func (p *EnumValueDescriptor) IsSetExtra() bool

func (*EnumValueDescriptor) String

func (p *EnumValueDescriptor) String() string

type FieldDescriptor

type FieldDescriptor struct {
	Filepath     string                `thrift:"filepath,1,required" json:"filepath"`
	Name         string                `thrift:"name,2,required" json:"name"`
	Type         *TypeDescriptor       `thrift:"type,3,required" json:"type"`
	Requiredness string                `thrift:"requiredness,4,required" json:"requiredness"`
	ID           int32                 `thrift:"id,5,required" json:"id"`
	DefaultValue *ConstValueDescriptor `thrift:"default_value,6,optional" json:"default_value,omitempty"`
	Annotations  map[string][]string   `thrift:"annotations,7,required" json:"annotations"`
	Comments     string                `thrift:"comments,8,required" json:"comments"`
	Extra        map[string]string     `thrift:"extra,9,optional" json:"extra,omitempty"`
}

func NewFieldDescriptor

func NewFieldDescriptor() *FieldDescriptor

func (*FieldDescriptor) GetAnnotations

func (p *FieldDescriptor) GetAnnotations() (v map[string][]string)

func (*FieldDescriptor) GetComments

func (p *FieldDescriptor) GetComments() (v string)

func (*FieldDescriptor) GetDefaultValue

func (p *FieldDescriptor) GetDefaultValue() (v *ConstValueDescriptor)

func (*FieldDescriptor) GetExtra

func (p *FieldDescriptor) GetExtra() (v map[string]string)

func (*FieldDescriptor) GetFilepath

func (p *FieldDescriptor) GetFilepath() (v string)

func (*FieldDescriptor) GetGoType

func (p *FieldDescriptor) GetGoType() (reflect.Type, error)

func (*FieldDescriptor) GetID

func (p *FieldDescriptor) GetID() (v int32)

func (*FieldDescriptor) GetInstanceValue

func (p *FieldDescriptor) GetInstanceValue(instance thriftReflectStruct) (val interface{}, err error)

GetInstanceValue Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func (*FieldDescriptor) GetName

func (p *FieldDescriptor) GetName() (v string)

func (*FieldDescriptor) GetRequiredness

func (p *FieldDescriptor) GetRequiredness() (v string)

func (*FieldDescriptor) GetType

func (p *FieldDescriptor) GetType() (v *TypeDescriptor)

func (*FieldDescriptor) InitDefault added in v0.3.16

func (p *FieldDescriptor) InitDefault()

func (*FieldDescriptor) IsDefault

func (p *FieldDescriptor) IsDefault() bool

func (*FieldDescriptor) IsOptional

func (p *FieldDescriptor) IsOptional() bool

func (*FieldDescriptor) IsRequired

func (p *FieldDescriptor) IsRequired() bool

func (*FieldDescriptor) IsSetDefaultValue

func (p *FieldDescriptor) IsSetDefaultValue() bool

func (*FieldDescriptor) IsSetExtra

func (p *FieldDescriptor) IsSetExtra() bool

func (*FieldDescriptor) IsSetType

func (p *FieldDescriptor) IsSetType() bool

func (*FieldDescriptor) SetInstanceValue

func (p *FieldDescriptor) SetInstanceValue(instance thriftReflectStruct, value interface{}) (err error)

SetInstanceValue Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func (*FieldDescriptor) String

func (p *FieldDescriptor) String() string

type FileDescriptor

type FileDescriptor struct {
	Filepath   string               `thrift:"filepath,1,required" json:"filepath"`
	Includes   map[string]string    `thrift:"includes,2,required" json:"includes"`
	Namespaces map[string]string    `thrift:"namespaces,3,required" json:"namespaces"`
	Services   []*ServiceDescriptor `thrift:"services,4,required" json:"services"`
	Structs    []*StructDescriptor  `thrift:"structs,5,required" json:"structs"`
	Exceptions []*StructDescriptor  `thrift:"exceptions,6,required" json:"exceptions"`
	Enums      []*EnumDescriptor    `thrift:"enums,7,required" json:"enums"`
	Typedefs   []*TypedefDescriptor `thrift:"typedefs,8,required" json:"typedefs"`
	Unions     []*StructDescriptor  `thrift:"unions,9,required" json:"unions"`
	Consts     []*ConstDescriptor   `thrift:"consts,10,required" json:"consts"`
	Extra      map[string]string    `thrift:"extra,11,optional" json:"extra,omitempty"`
}

func BuildFileDescriptor

func BuildFileDescriptor(builder *FileDescriptorBuilder) *FileDescriptor

func GetFileDescriptor

func GetFileDescriptor(ast *parser.Thrift) *FileDescriptor

func LookupFD

func LookupFD(filepath string) *FileDescriptor

func MustUnmarshal

func MustUnmarshal(bytes []byte) *FileDescriptor

func NewFileDescriptor

func NewFileDescriptor() *FileDescriptor

func ReplaceFileDescriptor

func ReplaceFileDescriptor(replacer *FileDescriptorReplacer) *FileDescriptor

func Unmarshal

func Unmarshal(bytes []byte) (*FileDescriptor, error)

func (*FileDescriptor) GetConstDescriptor

func (f *FileDescriptor) GetConstDescriptor(name string) *ConstDescriptor

func (*FileDescriptor) GetConsts

func (p *FileDescriptor) GetConsts() (v []*ConstDescriptor)

func (*FileDescriptor) GetEnumDescriptor

func (f *FileDescriptor) GetEnumDescriptor(name string) *EnumDescriptor

func (*FileDescriptor) GetEnums

func (p *FileDescriptor) GetEnums() (v []*EnumDescriptor)

func (*FileDescriptor) GetExceptionDescriptor

func (f *FileDescriptor) GetExceptionDescriptor(name string) *StructDescriptor

func (*FileDescriptor) GetExceptions

func (p *FileDescriptor) GetExceptions() (v []*StructDescriptor)

func (*FileDescriptor) GetExtra

func (p *FileDescriptor) GetExtra() (v map[string]string)

func (*FileDescriptor) GetFilepath

func (p *FileDescriptor) GetFilepath() (v string)

func (*FileDescriptor) GetIncludeFD

func (f *FileDescriptor) GetIncludeFD(alias string) *FileDescriptor

func (*FileDescriptor) GetIncludes

func (p *FileDescriptor) GetIncludes() (v map[string]string)

func (*FileDescriptor) GetMethodDescriptor

func (f *FileDescriptor) GetMethodDescriptor(service, method string) *MethodDescriptor

func (*FileDescriptor) GetNamespaces

func (p *FileDescriptor) GetNamespaces() (v map[string]string)

func (*FileDescriptor) GetServiceDescriptor

func (f *FileDescriptor) GetServiceDescriptor(name string) *ServiceDescriptor

func (*FileDescriptor) GetServices

func (p *FileDescriptor) GetServices() (v []*ServiceDescriptor)

func (*FileDescriptor) GetStructDescriptor

func (f *FileDescriptor) GetStructDescriptor(name string) *StructDescriptor

func (*FileDescriptor) GetStructs

func (p *FileDescriptor) GetStructs() (v []*StructDescriptor)

func (*FileDescriptor) GetTypedefDescriptor

func (f *FileDescriptor) GetTypedefDescriptor(name string) *TypedefDescriptor

func (*FileDescriptor) GetTypedefs

func (p *FileDescriptor) GetTypedefs() (v []*TypedefDescriptor)

func (*FileDescriptor) GetUnionDescriptor

func (f *FileDescriptor) GetUnionDescriptor(name string) *StructDescriptor

func (*FileDescriptor) GetUnions

func (p *FileDescriptor) GetUnions() (v []*StructDescriptor)

func (*FileDescriptor) InitDefault added in v0.3.16

func (p *FileDescriptor) InitDefault()

func (*FileDescriptor) IsSetExtra

func (p *FileDescriptor) IsSetExtra() bool

func (*FileDescriptor) Marshal

func (fd *FileDescriptor) Marshal() ([]byte, error)

func (*FileDescriptor) String

func (p *FileDescriptor) String() string

type FileDescriptorBuilder

type FileDescriptorBuilder struct {
	Bytes         []byte
	GoTypes       []interface{}
	GoPackagePath string
}

type FileDescriptorReplacer

type FileDescriptorReplacer struct {
	RemoteGoPkgPath  string
	CurrentGoPkgPath string
	CurrentFilepath  string
	Matcher          string
}

type GlobalDescriptor added in v0.3.8

type GlobalDescriptor struct {
	// contains filtered or unexported fields
}

func GetGlobalDescriptor added in v0.3.8

func GetGlobalDescriptor(v interface{ GetExtra() map[string]string }) *GlobalDescriptor

func (*GlobalDescriptor) GetEnumDescriptorByGoType added in v0.3.8

func (gd *GlobalDescriptor) GetEnumDescriptorByGoType(in interface{}) *EnumDescriptor

func (*GlobalDescriptor) GetStructDescriptorByGoType added in v0.3.8

func (gd *GlobalDescriptor) GetStructDescriptorByGoType(in interface{}) *StructDescriptor

func (*GlobalDescriptor) GetTypedefDescriptorByGoType added in v0.3.8

func (gd *GlobalDescriptor) GetTypedefDescriptorByGoType(in interface{}) *TypedefDescriptor

func (*GlobalDescriptor) LookupConst added in v0.3.8

func (gd *GlobalDescriptor) LookupConst(name, filepath string) *ConstDescriptor

func (*GlobalDescriptor) LookupEnum added in v0.3.8

func (gd *GlobalDescriptor) LookupEnum(name, filepath string) *EnumDescriptor

func (*GlobalDescriptor) LookupException added in v0.3.8

func (gd *GlobalDescriptor) LookupException(name, filepath string) *StructDescriptor

func (*GlobalDescriptor) LookupFD added in v0.3.8

func (gd *GlobalDescriptor) LookupFD(filepath string) *FileDescriptor

func (*GlobalDescriptor) LookupIncludedStructsFromMethod added in v0.3.8

func (gd *GlobalDescriptor) LookupIncludedStructsFromMethod(method *MethodDescriptor) ([]*StructDescriptor, error)

func (*GlobalDescriptor) LookupIncludedStructsFromStruct added in v0.3.8

func (gd *GlobalDescriptor) LookupIncludedStructsFromStruct(sd *StructDescriptor) ([]*StructDescriptor, error)

LookupIncludedStructsFromStruct finds all struct descriptor included by this structDescriptor (and current struct descriptor is also included in the return result)

func (*GlobalDescriptor) LookupIncludedStructsFromType added in v0.3.8

func (gd *GlobalDescriptor) LookupIncludedStructsFromType(td *TypeDescriptor) ([]*StructDescriptor, error)

func (*GlobalDescriptor) LookupMethod added in v0.3.8

func (gd *GlobalDescriptor) LookupMethod(method, service, filepath string) *MethodDescriptor

func (*GlobalDescriptor) LookupService added in v0.3.8

func (gd *GlobalDescriptor) LookupService(name, filepath string) *ServiceDescriptor

func (*GlobalDescriptor) LookupStruct added in v0.3.8

func (gd *GlobalDescriptor) LookupStruct(name, filepath string) *StructDescriptor

func (*GlobalDescriptor) LookupTypedef added in v0.3.8

func (gd *GlobalDescriptor) LookupTypedef(alias, filepath string) *TypedefDescriptor

func (*GlobalDescriptor) LookupUnion added in v0.3.8

func (gd *GlobalDescriptor) LookupUnion(name, filepath string) *StructDescriptor

func (*GlobalDescriptor) ShowRegisterInfo added in v0.3.8

func (gd *GlobalDescriptor) ShowRegisterInfo() map[string]string

type MethodDescriptor

type MethodDescriptor struct {
	Filepath        string              `thrift:"filepath,1,required" json:"filepath"`
	Name            string              `thrift:"name,2,required" json:"name"`
	Response        *TypeDescriptor     `thrift:"response,3,optional" json:"response,omitempty"`
	Args            []*FieldDescriptor  `thrift:"args,4,required" json:"args"`
	Annotations     map[string][]string `thrift:"annotations,5,required" json:"annotations"`
	Comments        string              `thrift:"comments,6,required" json:"comments"`
	ThrowExceptions []*FieldDescriptor  `thrift:"throw_exceptions,7,required" json:"throw_exceptions"`
	IsOneway        bool                `thrift:"is_oneway,8,required" json:"is_oneway"`
	Extra           map[string]string   `thrift:"extra,9,optional" json:"extra,omitempty"`
}

func LookupMethod

func LookupMethod(method, service, filepath string) *MethodDescriptor

func NewMethodDescriptor

func NewMethodDescriptor() *MethodDescriptor

func (*MethodDescriptor) GetAnnotations

func (p *MethodDescriptor) GetAnnotations() (v map[string][]string)

func (*MethodDescriptor) GetArgs

func (p *MethodDescriptor) GetArgs() (v []*FieldDescriptor)

func (*MethodDescriptor) GetComments

func (p *MethodDescriptor) GetComments() (v string)

func (*MethodDescriptor) GetExtra

func (p *MethodDescriptor) GetExtra() (v map[string]string)

func (*MethodDescriptor) GetFilepath

func (p *MethodDescriptor) GetFilepath() (v string)

func (*MethodDescriptor) GetIsOneway

func (p *MethodDescriptor) GetIsOneway() (v bool)

func (*MethodDescriptor) GetName

func (p *MethodDescriptor) GetName() (v string)

func (*MethodDescriptor) GetResponse

func (p *MethodDescriptor) GetResponse() (v *TypeDescriptor)

func (*MethodDescriptor) GetThrowExceptions

func (p *MethodDescriptor) GetThrowExceptions() (v []*FieldDescriptor)

func (*MethodDescriptor) InitDefault added in v0.3.16

func (p *MethodDescriptor) InitDefault()

func (*MethodDescriptor) IsSetExtra

func (p *MethodDescriptor) IsSetExtra() bool

func (*MethodDescriptor) IsSetResponse

func (p *MethodDescriptor) IsSetResponse() bool

func (*MethodDescriptor) String

func (p *MethodDescriptor) String() string

type ServiceDescriptor

type ServiceDescriptor struct {
	Filepath    string              `thrift:"filepath,1,required" json:"filepath"`
	Name        string              `thrift:"name,2,required" json:"name"`
	Methods     []*MethodDescriptor `thrift:"methods,3,required" json:"methods"`
	Annotations map[string][]string `thrift:"annotations,4,required" json:"annotations"`
	Comments    string              `thrift:"comments,5,required" json:"comments"`
	Extra       map[string]string   `thrift:"extra,6,optional" json:"extra,omitempty"`
	Base        string              `thrift:"base,7,optional" json:"base,omitempty"`
}

func LookupService

func LookupService(name, filepath string) *ServiceDescriptor

func NewServiceDescriptor

func NewServiceDescriptor() *ServiceDescriptor

func (*ServiceDescriptor) GetAllMethods added in v0.3.11

func (s *ServiceDescriptor) GetAllMethods() []*MethodDescriptor

func (*ServiceDescriptor) GetAnnotations

func (p *ServiceDescriptor) GetAnnotations() (v map[string][]string)

func (*ServiceDescriptor) GetBase added in v0.3.11

func (p *ServiceDescriptor) GetBase() (v string)

func (*ServiceDescriptor) GetComments

func (p *ServiceDescriptor) GetComments() (v string)

func (*ServiceDescriptor) GetExtra

func (p *ServiceDescriptor) GetExtra() (v map[string]string)

func (*ServiceDescriptor) GetFilepath

func (p *ServiceDescriptor) GetFilepath() (v string)

func (*ServiceDescriptor) GetMethodByName

func (sd *ServiceDescriptor) GetMethodByName(name string) *MethodDescriptor

func (*ServiceDescriptor) GetMethodByNameFromAll added in v0.3.11

func (s *ServiceDescriptor) GetMethodByNameFromAll(name string) *MethodDescriptor

func (*ServiceDescriptor) GetMethods

func (p *ServiceDescriptor) GetMethods() (v []*MethodDescriptor)

func (*ServiceDescriptor) GetName

func (p *ServiceDescriptor) GetName() (v string)

func (*ServiceDescriptor) GetParent added in v0.3.11

func (s *ServiceDescriptor) GetParent() *ServiceDescriptor

func (*ServiceDescriptor) InitDefault added in v0.3.16

func (p *ServiceDescriptor) InitDefault()

func (*ServiceDescriptor) IsSetBase added in v0.3.11

func (p *ServiceDescriptor) IsSetBase() bool

func (*ServiceDescriptor) IsSetExtra

func (p *ServiceDescriptor) IsSetExtra() bool

func (*ServiceDescriptor) String

func (p *ServiceDescriptor) String() string

type StructDescriptor

type StructDescriptor struct {
	Filepath    string              `thrift:"filepath,1,required" json:"filepath"`
	Name        string              `thrift:"name,2,required" json:"name"`
	Fields      []*FieldDescriptor  `thrift:"fields,3,required" json:"fields"`
	Annotations map[string][]string `thrift:"annotations,4,required" json:"annotations"`
	Comments    string              `thrift:"comments,5,required" json:"comments"`
	Extra       map[string]string   `thrift:"extra,6,optional" json:"extra,omitempty"`
}

func GetStructDescriptorByGoType

func GetStructDescriptorByGoType(in interface{}) *StructDescriptor

func LookupException

func LookupException(name, filepath string) *StructDescriptor

func LookupIncludedStructsFromMethod

func LookupIncludedStructsFromMethod(method *MethodDescriptor) ([]*StructDescriptor, error)

func LookupIncludedStructsFromStruct

func LookupIncludedStructsFromStruct(sd *StructDescriptor) ([]*StructDescriptor, error)

LookupIncludedStructsFromStruct finds all struct descriptor included by this structDescriptor (and current struct descriptor is also included in the return result)

func LookupIncludedStructsFromType

func LookupIncludedStructsFromType(td *TypeDescriptor) ([]*StructDescriptor, error)

func LookupStruct

func LookupStruct(name, filepath string) *StructDescriptor

func LookupUnion

func LookupUnion(name, filepath string) *StructDescriptor

func NewStructDescriptor

func NewStructDescriptor() *StructDescriptor

func (*StructDescriptor) GetAnnotations

func (p *StructDescriptor) GetAnnotations() (v map[string][]string)

func (*StructDescriptor) GetComments

func (p *StructDescriptor) GetComments() (v string)

func (*StructDescriptor) GetExtra

func (p *StructDescriptor) GetExtra() (v map[string]string)

func (*StructDescriptor) GetFieldById added in v0.3.3

func (s *StructDescriptor) GetFieldById(id int32) *FieldDescriptor

func (*StructDescriptor) GetFieldByName

func (s *StructDescriptor) GetFieldByName(name string) *FieldDescriptor

func (*StructDescriptor) GetFields

func (p *StructDescriptor) GetFields() (v []*FieldDescriptor)

func (*StructDescriptor) GetFilepath

func (p *StructDescriptor) GetFilepath() (v string)

func (*StructDescriptor) GetGoType

func (s *StructDescriptor) GetGoType() reflect.Type

func (*StructDescriptor) GetName

func (p *StructDescriptor) GetName() (v string)

func (*StructDescriptor) InitDefault added in v0.3.16

func (p *StructDescriptor) InitDefault()

func (*StructDescriptor) IsSetExtra

func (p *StructDescriptor) IsSetExtra() bool

func (*StructDescriptor) String

func (p *StructDescriptor) String() string

type TypeDescriptor

type TypeDescriptor struct {
	Filepath  string            `thrift:"filepath,1,required" json:"filepath"`
	Name      string            `thrift:"name,2,required" json:"name"`
	KeyType   *TypeDescriptor   `thrift:"key_type,3,optional" json:"key_type,omitempty"`
	ValueType *TypeDescriptor   `thrift:"value_type,4,optional" json:"value_type,omitempty"`
	Extra     map[string]string `thrift:"extra,5,optional" json:"extra,omitempty"`
}
var ConstDescriptor_Type_DEFAULT *TypeDescriptor
var FieldDescriptor_Type_DEFAULT *TypeDescriptor
var MethodDescriptor_Response_DEFAULT *TypeDescriptor
var TypeDescriptor_KeyType_DEFAULT *TypeDescriptor
var TypeDescriptor_ValueType_DEFAULT *TypeDescriptor
var TypedefDescriptor_Type_DEFAULT *TypeDescriptor

func GetTypeDescriptor

func GetTypeDescriptor(path string, typeStruct *parser.Type) *TypeDescriptor

func NewTypeDescriptor

func NewTypeDescriptor() *TypeDescriptor

func (*TypeDescriptor) GetEnumDescriptor

func (td *TypeDescriptor) GetEnumDescriptor() (*EnumDescriptor, error)

func (*TypeDescriptor) GetExceptionDescriptor

func (td *TypeDescriptor) GetExceptionDescriptor() (*StructDescriptor, error)

func (*TypeDescriptor) GetExtra

func (p *TypeDescriptor) GetExtra() (v map[string]string)

func (*TypeDescriptor) GetFilepath

func (p *TypeDescriptor) GetFilepath() (v string)

func (*TypeDescriptor) GetGoType

func (td *TypeDescriptor) GetGoType() (reflect.Type, error)

func (*TypeDescriptor) GetKeyType

func (p *TypeDescriptor) GetKeyType() (v *TypeDescriptor)

func (*TypeDescriptor) GetName

func (p *TypeDescriptor) GetName() (v string)

func (*TypeDescriptor) GetStructDescriptor

func (td *TypeDescriptor) GetStructDescriptor() (*StructDescriptor, error)

func (*TypeDescriptor) GetTypedefDescriptor

func (td *TypeDescriptor) GetTypedefDescriptor() (*TypedefDescriptor, error)

func (*TypeDescriptor) GetUnionDescriptor

func (td *TypeDescriptor) GetUnionDescriptor() (*StructDescriptor, error)

func (*TypeDescriptor) GetValueType

func (p *TypeDescriptor) GetValueType() (v *TypeDescriptor)

func (*TypeDescriptor) InitDefault added in v0.3.16

func (p *TypeDescriptor) InitDefault()

func (*TypeDescriptor) IsBasic

func (td *TypeDescriptor) IsBasic() bool

func (*TypeDescriptor) IsContainer

func (td *TypeDescriptor) IsContainer() bool

func (*TypeDescriptor) IsEnum

func (td *TypeDescriptor) IsEnum() bool

func (*TypeDescriptor) IsException

func (td *TypeDescriptor) IsException() bool

func (*TypeDescriptor) IsList

func (td *TypeDescriptor) IsList() bool

func (*TypeDescriptor) IsMap

func (td *TypeDescriptor) IsMap() bool

func (*TypeDescriptor) IsSetExtra

func (p *TypeDescriptor) IsSetExtra() bool

func (*TypeDescriptor) IsSetKeyType

func (p *TypeDescriptor) IsSetKeyType() bool

func (*TypeDescriptor) IsSetValueType

func (p *TypeDescriptor) IsSetValueType() bool

func (*TypeDescriptor) IsStruct

func (td *TypeDescriptor) IsStruct() bool

func (*TypeDescriptor) IsTypedef

func (td *TypeDescriptor) IsTypedef() bool

func (*TypeDescriptor) IsUnion

func (td *TypeDescriptor) IsUnion() bool

func (*TypeDescriptor) String

func (p *TypeDescriptor) String() string

type TypedefDescriptor

type TypedefDescriptor struct {
	Filepath    string              `thrift:"filepath,1,required" json:"filepath"`
	Type        *TypeDescriptor     `thrift:"type,2,required" json:"type"`
	Alias       string              `thrift:"alias,3,required" json:"alias"`
	Annotations map[string][]string `thrift:"annotations,4,required" json:"annotations"`
	Comments    string              `thrift:"comments,5,required" json:"comments"`
	Extra       map[string]string   `thrift:"extra,6,optional" json:"extra,omitempty"`
}

func GetTypedefDescriptorByGoType

func GetTypedefDescriptorByGoType(in interface{}) *TypedefDescriptor

func LookupTypedef

func LookupTypedef(alias, filepath string) *TypedefDescriptor

func NewTypedefDescriptor

func NewTypedefDescriptor() *TypedefDescriptor

func (*TypedefDescriptor) GetAlias

func (p *TypedefDescriptor) GetAlias() (v string)

func (*TypedefDescriptor) GetAnnotations

func (p *TypedefDescriptor) GetAnnotations() (v map[string][]string)

func (*TypedefDescriptor) GetComments

func (p *TypedefDescriptor) GetComments() (v string)

func (*TypedefDescriptor) GetExtra

func (p *TypedefDescriptor) GetExtra() (v map[string]string)

func (*TypedefDescriptor) GetFilepath

func (p *TypedefDescriptor) GetFilepath() (v string)

func (*TypedefDescriptor) GetGoType

func (s *TypedefDescriptor) GetGoType() reflect.Type

func (*TypedefDescriptor) GetType

func (p *TypedefDescriptor) GetType() (v *TypeDescriptor)

func (*TypedefDescriptor) InitDefault added in v0.3.16

func (p *TypedefDescriptor) InitDefault()

func (*TypedefDescriptor) IsSetExtra

func (p *TypedefDescriptor) IsSetExtra() bool

func (*TypedefDescriptor) IsSetType

func (p *TypedefDescriptor) IsSetType() bool

func (*TypedefDescriptor) String

func (p *TypedefDescriptor) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL