aop

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 16 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllInterfaceMetadata

func GetAllInterfaceMetadata() common.AllInterfaceMetadata

func GetMockProxyFunctionLayer

func GetMockProxyFunctionLayer() func(func())

func Load

func Load() error

func RegisterAOP

func RegisterAOP(aopImpl AOP)

Types

type AOP

type AOP struct {
	Name                  string
	InterceptorFactory    interceptorFactory
	RPCInterceptorFactory rpcInterceptorFactory
	GRPCServiceRegister   gRPCServiceRegister
	ConfigLoader          func(config *common.Config)
}

type Interceptor

type Interceptor interface {
	BeforeInvoke(ctx *InvocationContext)
	AfterInvoke(ctx *InvocationContext)
}

type InvocationContext

type InvocationContext struct {
	ID              uuid.UUID
	ProxyServicePtr interface{}
	SDID            string
	MethodName      string
	MethodFullName  string
	Params          []reflect.Value
	ReturnValues    []reflect.Value
	GrID            int64
	Metadata        map[string]interface{}
}

func NewInvocationContext

func NewInvocationContext(proxyServicePtr interface{}, sdid, methodName, methodFullName string, params []reflect.Value) *InvocationContext

func (*InvocationContext) SetReturnValues

func (c *InvocationContext) SetReturnValues(returnValues []reflect.Value)

type RPCInterceptor

type RPCInterceptor interface {
	BeforeClientInvoke(req *http.Request) error
	AfterClientInvoke(rsp *http.Response) error
	BeforeServerInvoke(c *gin.Context) error
	AfterServerInvoke(c *gin.Context) error
}

func GetRPCInterceptors

func GetRPCInterceptors() []RPCInterceptor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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