Documentation ¶
Index ¶
- Variables
- func ReadByType(ctx context.Context, protocol thrift.TProtocol, fieldType *FieldType, ...) (res interface{}, err error)
- func ReadList(ctx context.Context, protocol thrift.TProtocol, listType *FieldType) (interface{}, error)
- func ReadMap(ctx context.Context, protocol thrift.TProtocol, keyType *FieldType, ...) (res interface{}, err error)
- func ReadSet(ctx context.Context, protocol thrift.TProtocol, setType *FieldType) (interface{}, error)
- func ReadStructField(ctx context.Context, outProtocol thrift.TProtocol, field *Field, fieldId int16, ...) (interface{}, error)
- func ReadStructFields(ctx context.Context, inProtocol thrift.TProtocol, fields []*Field) (map[string]interface{}, error)
- func WriteByType(ctx context.Context, protocol thrift.TProtocol, fieldType *FieldType, ...) (err error)
- func WriteList(ctx context.Context, protocol thrift.TProtocol, listType *FieldType, ...) error
- func WriteMap(ctx context.Context, protocol thrift.TProtocol, keyType *FieldType, ...) error
- func WriteSet(ctx context.Context, protocol thrift.TProtocol, setType *FieldType, ...) error
- func WriteStructField(ctx context.Context, protocol thrift.TProtocol, field *Field, ...) error
- func WriteStructFields(ctx context.Context, protocol thrift.TProtocol, name string, fields []*Field, ...) error
- type Field
- type FieldType
- type MethodParam
- type Service
- type ServiceClient
- func NewServiceClient(c thrift.TClient) *ServiceClient
- func NewServiceClientByAddress(address string) (client *ServiceClient, err error)
- func NewServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ServiceClient
- func NewServiceClientProtocol(t thrift.TTransport, inProtocol thrift.TProtocol, outProtocol thrift.TProtocol) *ServiceClient
- func (this_ *ServiceClient) Client_() thrift.TClient
- func (this_ *ServiceClient) LastResponseMeta_() thrift.ResponseMeta
- func (this_ *ServiceClient) Send(ctx context.Context, param *MethodParam) (result interface{}, err error)
- func (this_ *ServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta)
- func (this_ *ServiceClient) Stop()
- type ServiceInfo
- type Struct
- type Workspace
- func (this_ *Workspace) AddIgnoreName(name string)
- func (this_ *Workspace) Clean()
- func (this_ *Workspace) GetDir() string
- func (this_ *Workspace) GetEnum(filename string, name string) *thrift.EnumStatement
- func (this_ *Workspace) GetErrors() map[string]error
- func (this_ *Workspace) GetException(filename string, name string) *thrift.ExceptionStatement
- func (this_ *Workspace) GetFieldByNode(filename string, fieldNode *thrift.FieldNode, structCache map[string]*Struct) (field *Field)
- func (this_ *Workspace) GetFieldDemoData(filename string, fieldNode *Field) (res interface{})
- func (this_ *Workspace) GetFieldDemoDataByType(filename string, fieldNode *FieldType) (res interface{})
- func (this_ *Workspace) GetFieldTypeByNode(filename string, fieldNode *thrift.FieldType, structCache map[string]*Struct) (fieldType *FieldType)
- func (this_ *Workspace) GetFields(filename string, params []*thrift.FieldNode, structCache map[string]*Struct) (fields []*Field)
- func (this_ *Workspace) GetFormatDir() string
- func (this_ *Workspace) GetIncludePath(filename string, name string) string
- func (this_ *Workspace) GetMethodParam(filename string, serviceName string, methodName string, args ...interface{}) (param *MethodParam, err error)
- func (this_ *Workspace) GetRelativePath(filename string) string
- func (this_ *Workspace) GetService(filename string, name string) *thrift.ServiceStatement
- func (this_ *Workspace) GetServiceMethod(filename string, serviceName string, name string) *thrift.ServiceMethodNode
- func (this_ *Workspace) GetStruct(filename string, name string) *thrift.StructStatement
- func (this_ *Workspace) GetStructByName(filename string, include string, name string, structCache map[string]*Struct) (res *Struct)
- func (this_ *Workspace) GetStructDemoData(filename string, include string, name string) (res interface{})
- func (this_ *Workspace) IncludeSubDir(includeSubDir bool)
- func (this_ *Workspace) InvokeByServerAddress(serverAddress string, filename string, serviceName string, methodName string, ...) (param *MethodParam, err error)
- func (this_ *Workspace) IsIgnoreName(name string) bool
- func (this_ *Workspace) IsIncludeSubDir() bool
- func (this_ *Workspace) Load()
- func (this_ *Workspace) Reload()
- func (this_ *Workspace) SetEnum(filename string, value *thrift.EnumStatement)
- func (this_ *Workspace) SetException(filename string, value *thrift.ExceptionStatement)
- func (this_ *Workspace) SetIncludePath(dir string, filename string, value *thrift.IncludeStatement)
- func (this_ *Workspace) SetService(filename string, value *thrift.ServiceStatement)
- func (this_ *Workspace) SetServiceMethod(filename string, serviceName string, value *thrift.ServiceMethodNode)
- func (this_ *Workspace) SetStruct(filename string, value *thrift.StructStatement)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
BINARY thrift.TType = 18 // 兼容 thrift.BINARY 类型 即 []byte
)
Functions ¶
func ReadByType ¶
func ReadStructField ¶
func ReadStructFields ¶
func WriteByType ¶
func WriteStructField ¶
Types ¶
type FieldType ¶
type FieldType struct { TypeId thrift.TType `json:"typeId"` StructInclude string `json:"structInclude"` StructName string `json:"structName"` SetType *FieldType `json:"setType"` ListType *FieldType `json:"listType"` MapKeyType *FieldType `json:"mapKeyType"` MapValueType *FieldType `json:"mapValueType"` // contains filtered or unexported fields }
type MethodParam ¶
type MethodParam struct { Name string `json:"name"` Args []interface{} `json:"args"` ArgFields []*Field `json:"argFields,omitempty"` Result interface{} `json:"result"` Exceptions []interface{} `json:"exceptions"` ResultType *FieldType `json:"resultFiled,omitempty"` ExceptionFields []*Field `json:"exceptionFields,omitempty"` ReadStart int64 `json:"readStart"` ReadEnd int64 `json:"readEnd"` WriteStart int64 `json:"writeStart"` WriteEnd int64 `json:"writeEnd"` UseTime int64 `json:"useTime"` Error string `json:"error"` }
func (*MethodParam) String ¶
func (this_ *MethodParam) String() string
type Service ¶
type Service interface {
Send(ctx context.Context, param *MethodParam) (result interface{}, err error)
}
type ServiceClient ¶
type ServiceClient struct { TTransport thrift.TTransport TClient thrift.TClient // contains filtered or unexported fields }
func NewServiceClient ¶
func NewServiceClient(c thrift.TClient) *ServiceClient
func NewServiceClientByAddress ¶
func NewServiceClientByAddress(address string) (client *ServiceClient, err error)
func NewServiceClientFactory ¶
func NewServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ServiceClient
func NewServiceClientProtocol ¶
func NewServiceClientProtocol(t thrift.TTransport, inProtocol thrift.TProtocol, outProtocol thrift.TProtocol) *ServiceClient
func (*ServiceClient) Client_ ¶
func (this_ *ServiceClient) Client_() thrift.TClient
func (*ServiceClient) LastResponseMeta_ ¶
func (this_ *ServiceClient) LastResponseMeta_() thrift.ResponseMeta
func (*ServiceClient) Send ¶
func (this_ *ServiceClient) Send(ctx context.Context, param *MethodParam) (result interface{}, err error)
func (*ServiceClient) SetLastResponseMeta_ ¶
func (this_ *ServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta)
func (*ServiceClient) Stop ¶ added in v0.3.6
func (this_ *ServiceClient) Stop()
type ServiceInfo ¶
type ServiceInfo struct { *thrift.ServiceStatement Filename string `json:"filename"` Name string `json:"name"` RelativePath string `json:"relativePath"` }
type Workspace ¶
type Workspace struct { ServiceList []*ServiceInfo // contains filtered or unexported fields }
func NewWorkspace ¶
func (*Workspace) AddIgnoreName ¶
func (*Workspace) GetEnum ¶
func (this_ *Workspace) GetEnum(filename string, name string) *thrift.EnumStatement
func (*Workspace) GetException ¶
func (this_ *Workspace) GetException(filename string, name string) *thrift.ExceptionStatement
func (*Workspace) GetFieldByNode ¶
func (*Workspace) GetFieldDemoData ¶ added in v0.3.4
func (*Workspace) GetFieldDemoDataByType ¶ added in v0.3.4
func (*Workspace) GetFieldTypeByNode ¶
func (*Workspace) GetFormatDir ¶
func (*Workspace) GetIncludePath ¶
func (*Workspace) GetMethodParam ¶
func (*Workspace) GetRelativePath ¶
func (*Workspace) GetService ¶
func (this_ *Workspace) GetService(filename string, name string) *thrift.ServiceStatement
func (*Workspace) GetServiceMethod ¶
func (*Workspace) GetStruct ¶
func (this_ *Workspace) GetStruct(filename string, name string) *thrift.StructStatement
func (*Workspace) GetStructByName ¶
func (*Workspace) GetStructDemoData ¶ added in v0.3.4
func (*Workspace) IncludeSubDir ¶
func (*Workspace) InvokeByServerAddress ¶
func (*Workspace) IsIgnoreName ¶
func (*Workspace) IsIncludeSubDir ¶
func (*Workspace) SetEnum ¶
func (this_ *Workspace) SetEnum(filename string, value *thrift.EnumStatement)
func (*Workspace) SetException ¶
func (this_ *Workspace) SetException(filename string, value *thrift.ExceptionStatement)
func (*Workspace) SetIncludePath ¶
func (this_ *Workspace) SetIncludePath(dir string, filename string, value *thrift.IncludeStatement)
func (*Workspace) SetService ¶
func (this_ *Workspace) SetService(filename string, value *thrift.ServiceStatement)
func (*Workspace) SetServiceMethod ¶
func (this_ *Workspace) SetServiceMethod(filename string, serviceName string, value *thrift.ServiceMethodNode)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.