aop

package
v0.0.0-...-3a05b22 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const MetadataKey = "aop"

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
	// ConfigLoader is called during ioc.Load() when aop is enabled
	ConfigLoader func(config *common.Config)

	// InterceptorFactory is called after ConfigLoader is called, when bot aop and debug-server are enabled
	InterceptorFactory interceptorFactory
	// RPCInterceptorFactory is called after ConfigLoader is called, when bot aop and debug-server are enabled
	RPCInterceptorFactory rpcInterceptorFactory
	// GRPCServiceRegister is called after ConfigLoader is called, when bot aop and debug-server are enabled
	GRPCServiceRegister gRPCServiceRegister
}

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 GetCurrentInvocationCtx

func GetCurrentInvocationCtx() *InvocationContext

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 Metadata

type Metadata map[string]interface{}

func ParseAOPMetadataFromSDMetadata

func ParseAOPMetadataFromSDMetadata(metadata autowire.Metadata) Metadata

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