thrift_reflection

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 16 Imported by: 14

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)

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

func (p *ConstDescriptor) IsSetExtra() bool

func (*ConstDescriptor) IsSetType

func (p *ConstDescriptor) IsSetType() bool

func (*ConstDescriptor) IsSetValue

func (p *ConstDescriptor) IsSetValue() bool

func (*ConstDescriptor) Read

func (p *ConstDescriptor) Read(iprot thrift.TProtocol) (err error)

func (*ConstDescriptor) ReadField1

func (p *ConstDescriptor) ReadField1(iprot thrift.TProtocol) error

func (*ConstDescriptor) ReadField2

func (p *ConstDescriptor) ReadField2(iprot thrift.TProtocol) error

func (*ConstDescriptor) ReadField3

func (p *ConstDescriptor) ReadField3(iprot thrift.TProtocol) error

func (*ConstDescriptor) ReadField4

func (p *ConstDescriptor) ReadField4(iprot thrift.TProtocol) error

func (*ConstDescriptor) ReadField5

func (p *ConstDescriptor) ReadField5(iprot thrift.TProtocol) error

func (*ConstDescriptor) ReadField6

func (p *ConstDescriptor) ReadField6(iprot thrift.TProtocol) error

func (*ConstDescriptor) ReadField7

func (p *ConstDescriptor) ReadField7(iprot thrift.TProtocol) error

func (*ConstDescriptor) String

func (p *ConstDescriptor) String() string

func (*ConstDescriptor) Write

func (p *ConstDescriptor) Write(oprot thrift.TProtocol) (err error)

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

func (p *ConstValueDescriptor) Read(iprot thrift.TProtocol) (err error)

func (*ConstValueDescriptor) ReadField1

func (p *ConstValueDescriptor) ReadField1(iprot thrift.TProtocol) error

func (*ConstValueDescriptor) ReadField2

func (p *ConstValueDescriptor) ReadField2(iprot thrift.TProtocol) error

func (*ConstValueDescriptor) ReadField3

func (p *ConstValueDescriptor) ReadField3(iprot thrift.TProtocol) error

func (*ConstValueDescriptor) ReadField4

func (p *ConstValueDescriptor) ReadField4(iprot thrift.TProtocol) error

func (*ConstValueDescriptor) ReadField5

func (p *ConstValueDescriptor) ReadField5(iprot thrift.TProtocol) error

func (*ConstValueDescriptor) ReadField6

func (p *ConstValueDescriptor) ReadField6(iprot thrift.TProtocol) error

func (*ConstValueDescriptor) ReadField7

func (p *ConstValueDescriptor) ReadField7(iprot thrift.TProtocol) error

func (*ConstValueDescriptor) ReadField8

func (p *ConstValueDescriptor) ReadField8(iprot thrift.TProtocol) error

func (*ConstValueDescriptor) ReadField9 added in v0.3.8

func (p *ConstValueDescriptor) ReadField9(iprot thrift.TProtocol) error

func (*ConstValueDescriptor) String

func (p *ConstValueDescriptor) String() string

func (*ConstValueDescriptor) Write

func (p *ConstValueDescriptor) Write(oprot thrift.TProtocol) (err error)

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

func (p *EnumDescriptor) IsSetExtra() bool

func (*EnumDescriptor) Read

func (p *EnumDescriptor) Read(iprot thrift.TProtocol) (err error)

func (*EnumDescriptor) ReadField1

func (p *EnumDescriptor) ReadField1(iprot thrift.TProtocol) error

func (*EnumDescriptor) ReadField2

func (p *EnumDescriptor) ReadField2(iprot thrift.TProtocol) error

func (*EnumDescriptor) ReadField3

func (p *EnumDescriptor) ReadField3(iprot thrift.TProtocol) error

func (*EnumDescriptor) ReadField4

func (p *EnumDescriptor) ReadField4(iprot thrift.TProtocol) error

func (*EnumDescriptor) ReadField5

func (p *EnumDescriptor) ReadField5(iprot thrift.TProtocol) error

func (*EnumDescriptor) ReadField6

func (p *EnumDescriptor) ReadField6(iprot thrift.TProtocol) error

func (*EnumDescriptor) String

func (p *EnumDescriptor) String() string

func (*EnumDescriptor) Write

func (p *EnumDescriptor) Write(oprot thrift.TProtocol) (err error)

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

func (p *EnumValueDescriptor) IsSetExtra() bool

func (*EnumValueDescriptor) Read

func (p *EnumValueDescriptor) Read(iprot thrift.TProtocol) (err error)

func (*EnumValueDescriptor) ReadField1

func (p *EnumValueDescriptor) ReadField1(iprot thrift.TProtocol) error

func (*EnumValueDescriptor) ReadField2

func (p *EnumValueDescriptor) ReadField2(iprot thrift.TProtocol) error

func (*EnumValueDescriptor) ReadField3

func (p *EnumValueDescriptor) ReadField3(iprot thrift.TProtocol) error

func (*EnumValueDescriptor) ReadField4

func (p *EnumValueDescriptor) ReadField4(iprot thrift.TProtocol) error

func (*EnumValueDescriptor) ReadField5

func (p *EnumValueDescriptor) ReadField5(iprot thrift.TProtocol) error

func (*EnumValueDescriptor) ReadField6

func (p *EnumValueDescriptor) ReadField6(iprot thrift.TProtocol) error

func (*EnumValueDescriptor) String

func (p *EnumValueDescriptor) String() string

func (*EnumValueDescriptor) Write

func (p *EnumValueDescriptor) Write(oprot thrift.TProtocol) (err error)

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

func (p *FieldDescriptor) Read(iprot thrift.TProtocol) (err error)

func (*FieldDescriptor) ReadField1

func (p *FieldDescriptor) ReadField1(iprot thrift.TProtocol) error

func (*FieldDescriptor) ReadField2

func (p *FieldDescriptor) ReadField2(iprot thrift.TProtocol) error

func (*FieldDescriptor) ReadField3

func (p *FieldDescriptor) ReadField3(iprot thrift.TProtocol) error

func (*FieldDescriptor) ReadField4

func (p *FieldDescriptor) ReadField4(iprot thrift.TProtocol) error

func (*FieldDescriptor) ReadField5

func (p *FieldDescriptor) ReadField5(iprot thrift.TProtocol) error

func (*FieldDescriptor) ReadField6

func (p *FieldDescriptor) ReadField6(iprot thrift.TProtocol) error

func (*FieldDescriptor) ReadField7

func (p *FieldDescriptor) ReadField7(iprot thrift.TProtocol) error

func (*FieldDescriptor) ReadField8

func (p *FieldDescriptor) ReadField8(iprot thrift.TProtocol) error

func (*FieldDescriptor) ReadField9

func (p *FieldDescriptor) ReadField9(iprot thrift.TProtocol) error

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

func (*FieldDescriptor) Write

func (p *FieldDescriptor) Write(oprot thrift.TProtocol) (err error)

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

func (p *FileDescriptor) IsSetExtra() bool

func (*FileDescriptor) Marshal

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

func (*FileDescriptor) Read

func (p *FileDescriptor) Read(iprot thrift.TProtocol) (err error)

func (*FileDescriptor) ReadField1

func (p *FileDescriptor) ReadField1(iprot thrift.TProtocol) error

func (*FileDescriptor) ReadField10

func (p *FileDescriptor) ReadField10(iprot thrift.TProtocol) error

func (*FileDescriptor) ReadField11

func (p *FileDescriptor) ReadField11(iprot thrift.TProtocol) error

func (*FileDescriptor) ReadField2

func (p *FileDescriptor) ReadField2(iprot thrift.TProtocol) error

func (*FileDescriptor) ReadField3

func (p *FileDescriptor) ReadField3(iprot thrift.TProtocol) error

func (*FileDescriptor) ReadField4

func (p *FileDescriptor) ReadField4(iprot thrift.TProtocol) error

func (*FileDescriptor) ReadField5

func (p *FileDescriptor) ReadField5(iprot thrift.TProtocol) error

func (*FileDescriptor) ReadField6

func (p *FileDescriptor) ReadField6(iprot thrift.TProtocol) error

func (*FileDescriptor) ReadField7

func (p *FileDescriptor) ReadField7(iprot thrift.TProtocol) error

func (*FileDescriptor) ReadField8

func (p *FileDescriptor) ReadField8(iprot thrift.TProtocol) error

func (*FileDescriptor) ReadField9

func (p *FileDescriptor) ReadField9(iprot thrift.TProtocol) error

func (*FileDescriptor) String

func (p *FileDescriptor) String() string

func (*FileDescriptor) Write

func (p *FileDescriptor) Write(oprot thrift.TProtocol) (err error)

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

func (p *MethodDescriptor) IsSetExtra() bool

func (*MethodDescriptor) IsSetResponse

func (p *MethodDescriptor) IsSetResponse() bool

func (*MethodDescriptor) Read

func (p *MethodDescriptor) Read(iprot thrift.TProtocol) (err error)

func (*MethodDescriptor) ReadField1

func (p *MethodDescriptor) ReadField1(iprot thrift.TProtocol) error

func (*MethodDescriptor) ReadField2

func (p *MethodDescriptor) ReadField2(iprot thrift.TProtocol) error

func (*MethodDescriptor) ReadField3

func (p *MethodDescriptor) ReadField3(iprot thrift.TProtocol) error

func (*MethodDescriptor) ReadField4

func (p *MethodDescriptor) ReadField4(iprot thrift.TProtocol) error

func (*MethodDescriptor) ReadField5

func (p *MethodDescriptor) ReadField5(iprot thrift.TProtocol) error

func (*MethodDescriptor) ReadField6

func (p *MethodDescriptor) ReadField6(iprot thrift.TProtocol) error

func (*MethodDescriptor) ReadField7

func (p *MethodDescriptor) ReadField7(iprot thrift.TProtocol) error

func (*MethodDescriptor) ReadField8

func (p *MethodDescriptor) ReadField8(iprot thrift.TProtocol) error

func (*MethodDescriptor) ReadField9

func (p *MethodDescriptor) ReadField9(iprot thrift.TProtocol) error

func (*MethodDescriptor) String

func (p *MethodDescriptor) String() string

func (*MethodDescriptor) Write

func (p *MethodDescriptor) Write(oprot thrift.TProtocol) (err error)

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) IsSetBase added in v0.3.11

func (p *ServiceDescriptor) IsSetBase() bool

func (*ServiceDescriptor) IsSetExtra

func (p *ServiceDescriptor) IsSetExtra() bool

func (*ServiceDescriptor) Read

func (p *ServiceDescriptor) Read(iprot thrift.TProtocol) (err error)

func (*ServiceDescriptor) ReadField1

func (p *ServiceDescriptor) ReadField1(iprot thrift.TProtocol) error

func (*ServiceDescriptor) ReadField2

func (p *ServiceDescriptor) ReadField2(iprot thrift.TProtocol) error

func (*ServiceDescriptor) ReadField3

func (p *ServiceDescriptor) ReadField3(iprot thrift.TProtocol) error

func (*ServiceDescriptor) ReadField4

func (p *ServiceDescriptor) ReadField4(iprot thrift.TProtocol) error

func (*ServiceDescriptor) ReadField5

func (p *ServiceDescriptor) ReadField5(iprot thrift.TProtocol) error

func (*ServiceDescriptor) ReadField6

func (p *ServiceDescriptor) ReadField6(iprot thrift.TProtocol) error

func (*ServiceDescriptor) ReadField7 added in v0.3.11

func (p *ServiceDescriptor) ReadField7(iprot thrift.TProtocol) error

func (*ServiceDescriptor) String

func (p *ServiceDescriptor) String() string

func (*ServiceDescriptor) Write

func (p *ServiceDescriptor) Write(oprot thrift.TProtocol) (err error)

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

func (p *StructDescriptor) IsSetExtra() bool

func (*StructDescriptor) Read

func (p *StructDescriptor) Read(iprot thrift.TProtocol) (err error)

func (*StructDescriptor) ReadField1

func (p *StructDescriptor) ReadField1(iprot thrift.TProtocol) error

func (*StructDescriptor) ReadField2

func (p *StructDescriptor) ReadField2(iprot thrift.TProtocol) error

func (*StructDescriptor) ReadField3

func (p *StructDescriptor) ReadField3(iprot thrift.TProtocol) error

func (*StructDescriptor) ReadField4

func (p *StructDescriptor) ReadField4(iprot thrift.TProtocol) error

func (*StructDescriptor) ReadField5

func (p *StructDescriptor) ReadField5(iprot thrift.TProtocol) error

func (*StructDescriptor) ReadField6

func (p *StructDescriptor) ReadField6(iprot thrift.TProtocol) error

func (*StructDescriptor) String

func (p *StructDescriptor) String() string

func (*StructDescriptor) Write

func (p *StructDescriptor) Write(oprot thrift.TProtocol) (err error)

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

func (p *TypeDescriptor) Read(iprot thrift.TProtocol) (err error)

func (*TypeDescriptor) ReadField1

func (p *TypeDescriptor) ReadField1(iprot thrift.TProtocol) error

func (*TypeDescriptor) ReadField2

func (p *TypeDescriptor) ReadField2(iprot thrift.TProtocol) error

func (*TypeDescriptor) ReadField3

func (p *TypeDescriptor) ReadField3(iprot thrift.TProtocol) error

func (*TypeDescriptor) ReadField4

func (p *TypeDescriptor) ReadField4(iprot thrift.TProtocol) error

func (*TypeDescriptor) ReadField5

func (p *TypeDescriptor) ReadField5(iprot thrift.TProtocol) error

func (*TypeDescriptor) String

func (p *TypeDescriptor) String() string

func (*TypeDescriptor) Write

func (p *TypeDescriptor) Write(oprot thrift.TProtocol) (err error)

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

func (p *TypedefDescriptor) IsSetExtra() bool

func (*TypedefDescriptor) IsSetType

func (p *TypedefDescriptor) IsSetType() bool

func (*TypedefDescriptor) Read

func (p *TypedefDescriptor) Read(iprot thrift.TProtocol) (err error)

func (*TypedefDescriptor) ReadField1

func (p *TypedefDescriptor) ReadField1(iprot thrift.TProtocol) error

func (*TypedefDescriptor) ReadField2

func (p *TypedefDescriptor) ReadField2(iprot thrift.TProtocol) error

func (*TypedefDescriptor) ReadField3

func (p *TypedefDescriptor) ReadField3(iprot thrift.TProtocol) error

func (*TypedefDescriptor) ReadField4

func (p *TypedefDescriptor) ReadField4(iprot thrift.TProtocol) error

func (*TypedefDescriptor) ReadField5

func (p *TypedefDescriptor) ReadField5(iprot thrift.TProtocol) error

func (*TypedefDescriptor) ReadField6

func (p *TypedefDescriptor) ReadField6(iprot thrift.TProtocol) error

func (*TypedefDescriptor) String

func (p *TypedefDescriptor) String() string

func (*TypedefDescriptor) Write

func (p *TypedefDescriptor) Write(oprot thrift.TProtocol) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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