aop

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delegate

type Delegate struct {
	Receiver interface{}
	Method   reflect.Method
	Params   []reflect.Value
	Result   []reflect.Value
}

func NewDelegate

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

type ProxiesAspect

type ProxiesAspect interface {
	RegisterDelegate(delegateType reflect.Type)
	RegisterProxy(proxy Proxy) error
	// contains filtered or unexported methods
}
var (
	SingletonAspect ProxiesAspect
)

func GetSingletonAspectInstance

func GetSingletonAspectInstance() ProxiesAspect

type Proxy

type Proxy interface {
	GetProxyName() string
	Before(delegate *Delegate, methodLocation string) bool
	After(delegate *Delegate, methodLocation string)
	Finally(delegate *Delegate, methodLocation string)
	IsMatch(methodLocation string) bool
}

func NewProxy

func NewProxy(
	proxyName string,
	beforeFn func(delegate *Delegate, methodLocation string) bool,
	afterFn func(delegate *Delegate, methodLocation string),
	finallyFn func(delegate *Delegate, methodLocation string),
	isMatch func(methodLocation string) bool,
) (Proxy, error)

Jump to

Keyboard shortcuts

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