Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCallOld = errors.New("mock: call old")
Functions ¶
func AddFuncInterceptor
deprecated
func AddFuncInterceptor(fn interface{}, interceptor Interceptor) func()
Deprecated: use Mock instead
func Mock ¶ added in v1.0.6
func Mock(fn interface{}, interceptor Interceptor) func()
Mock setup mock on given function `fn`. `fn` can be a function or a method, when `fn` is a method, only the bound instance will be mocked, other instances are not affected. The returned function can be used to cancel the passed interceptor.
Types ¶
type Interceptor ¶
type Interceptor func(ctx context.Context, fn *core.FuncInfo, args core.Object, results core.Object) error
func GetInterceptors ¶
func GetInterceptors() []Interceptor
Click to show internal directories.
Click to hide internal directories.