aop

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPoint

func RegisterPoint(pointType reflect.Type, aspect AspectInterface)

注册切点

Types

type AspectInterface

type AspectInterface interface {
	Before(point *JoinPoint) (bool, error)
	After(point *JoinPoint)
	Finally(point *JoinPoint)
}

切面接口

type JoinPoint

type JoinPoint struct {
	Receiver interface{}
	Method   reflect.Method
	Params   []reflect.Value
	Result   []reflect.Value
	// contains filtered or unexported fields
}

连接点

func NewJoinPoint

func NewJoinPoint(receiver interface{}, params []reflect.Value, method reflect.Method) *JoinPoint

type ServerAspect

type ServerAspect struct{}

func (*ServerAspect) After

func (a *ServerAspect) After(point *JoinPoint)

func (*ServerAspect) Before

func (a *ServerAspect) Before(point *JoinPoint) (bool, error)

func (*ServerAspect) Finally

func (a *ServerAspect) Finally(point *JoinPoint)

Jump to

Keyboard shortcuts

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