hessian2

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 10

Documentation

Index

Constants

View Source
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

func GetParamsTypeList(params []*Parameter) (string, error)

GetParamsTypeList is copied from dubbo-go, it should be rewritten

func NewDecoder

func NewDecoder(b []byte) iface.Decoder

func NewEncoder

func NewEncoder() iface.Encoder

func ReflectResponse

func ReflectResponse(in, out interface{}) error

ReflectResponse reflect return value

func Register

func Register(pojos []interface{})

Types

type Decoder

type Decoder struct {
	hessian.Decoder
}

type Encoder

type Encoder struct {
	hessian.Encoder
}

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.

func (*Group) Do

func (g *Group) Do(key methodKey, fn func() (interface{}, error)) (v interface{}, err error, shared bool)

func (*Group) DoChan

func (g *Group) DoChan(key methodKey, fn func() (interface{}, error)) <-chan Result

func (*Group) Forget

func (g *Group) Forget(key methodKey)

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

func NewParameter(value interface{}, typeAnno string) *Parameter

NewParameter create a Parameter object.

type Result

type Result struct {
	Val    interface{}
	Err    error
	Shared bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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