Documentation ¶
Index ¶
- Constants
- func GetParamsTypeList(params []*Parameter) (string, error)
- func NewDecoder(b []byte) iface.Decoder
- func NewEncoder() iface.Encoder
- func ReflectResponse(in, out interface{}) error
- func Register(pojos []interface{})
- type Decoder
- type Encoder
- type Group
- type MethodAnnotation
- type MethodCache
- type Parameter
- type Result
Constants ¶
const ( NULL = hessian.BC_NULL HESSIAN_ARGS_TYPE_TAG = "hessian.argsType" HESSIAN_JAVA_METHOD_NAME_TAG = "JavaMethodName" )
Variables ¶
This section is empty.
Functions ¶
func GetParamsTypeList ¶ added in v0.2.0
GetParamsTypeList is copied from dubbo-go, it should be rewritten
func NewDecoder ¶
func NewEncoder ¶
func ReflectResponse ¶
func ReflectResponse(in, out interface{}) error
ReflectResponse reflect return value
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group represents a class of work and forms a namespace in which units of work can be executed with duplicate suppression. The only difference between this Group and golang.org/x/sync/singleflight is that key is reflect.Type cause reflect.Type.String() could not be guaranteed to be unique.
type MethodAnnotation ¶ added in v0.2.0
type MethodAnnotation struct {
// contains filtered or unexported fields
}
MethodAnnotation Used to store parameter types and parameter names in method annotations.
func NewMethodAnnotation ¶ added in v0.2.0
func NewMethodAnnotation(annos map[string][]string) *MethodAnnotation
NewMethodAnnotation is used to create a method annotation object.
func (*MethodAnnotation) GetFieldType ¶ added in v0.2.0
func (ma *MethodAnnotation) GetFieldType(i int) string
GetFieldType retrieves the type annotation for a field by its index.
func (*MethodAnnotation) GetMethodName ¶ added in v0.2.0
func (ma *MethodAnnotation) GetMethodName() (string, bool)
GetMethodName get the method name specified by the method annotation.
type MethodCache ¶ added in v0.1.2
type MethodCache struct {
// contains filtered or unexported fields
}
MethodCache maintains a cache from method parameter types (reflect.Type) and method annotations to the type strings used by Hessian2.
func (*MethodCache) GetTypes ¶ added in v0.1.2
func (mc *MethodCache) GetTypes(data interface{}, ma *MethodAnnotation) (string, error)
GetTypes returns the Types string for the given method parameter data and method annotations. It reads embedded sync.Map firstly. If cache misses, using singleFlight to process reflection and GetParamsTypeList.
type Parameter ¶ added in v0.2.0
type Parameter struct {
// contains filtered or unexported fields
}
Parameter is used to store information about parameters. value stores the actual value of the parameter, and typeAnno records the type annotation added by IDL to this parameter.
func NewParameter ¶ added in v0.2.0
NewParameter create a Parameter object.