vmock

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reset

func Reset(patche *Patches)

Reset resets a single patch with thread safety patche: the patch to be reset Note: Includes a small delay after reset to ensure effectiveness

func ResetAll

func ResetAll(patches []*Patches)

ResetAll resets multiple patches patches: array of patches to be reset

Types

type OutputCell

type OutputCell = gomonkey.OutputCell

OutputCell is an alias for gomonkey.OutputCell

type Params

type Params = gomonkey.Params

Params is an alias for gomonkey.Params

type Patches

type Patches = gomonkey.Patches

Patches is an alias for gomonkey.Patches

func ApplyFunc

func ApplyFunc(target, double interface{}) *Patches

ApplyFunc applies a mock to a function target: the function to be mocked double: the mock implementation Returns: a Patches instance for cleanup

func ApplyFuncReturn

func ApplyFuncReturn(target interface{}, output ...interface{}) *Patches

ApplyFuncReturn applies a mock to a function with specified return values target: the function to be mocked output: the values to be returned Returns: a Patches instance for cleanup

func ApplyFuncSeq

func ApplyFuncSeq(target interface{}, outputs []OutputCell) *Patches

ApplyFuncSeq applies a mock to a function with a sequence of outputs target: the function to be mocked outputs: sequence of output values Returns: a Patches instance for cleanup

func ApplyFuncVar

func ApplyFuncVar(target, double interface{}) *Patches

ApplyFuncVar applies a mock to a variable function target: the variable function to be mocked double: the mock implementation Returns: a Patches instance for cleanup

func ApplyFuncVarReturn

func ApplyFuncVarReturn(target interface{}, output ...interface{}) *Patches

ApplyFuncVarReturn applies a mock to a variable function with specified return values target: the variable function to be mocked output: the values to be returned Returns: a Patches instance for cleanup

func ApplyFuncVarSeq

func ApplyFuncVarSeq(target interface{}, outputs []OutputCell) *Patches

ApplyFuncVarSeq applies a mock to a variable function with a sequence of outputs target: the variable function to be mocked outputs: sequence of output values Returns: a Patches instance for cleanup

func ApplyGlobalVar

func ApplyGlobalVar(target, double interface{}) *Patches

ApplyGlobalVar applies a mock to a global variable target: the global variable to be mocked double: the mock value Returns: a Patches instance for cleanup

func ApplyMethod

func ApplyMethod(target interface{}, methodName string, double interface{}) *Patches

ApplyMethod applies a mock to a method target: the target type methodName: name of the method to be mocked double: the mock implementation Returns: a Patches instance for cleanup

func ApplyMethodFunc

func ApplyMethodFunc(target interface{}, methodName string, doubleFunc interface{}) *Patches

ApplyMethodFunc applies a mock function to a method target: the target type methodName: name of the method to be mocked doubleFunc: the mock function Returns: a Patches instance for cleanup

func ApplyMethodReturn

func ApplyMethodReturn(target interface{}, methodName string, output ...interface{}) *Patches

ApplyMethodReturn applies a mock to a method with specified return values target: the target type methodName: name of the method to be mocked output: the values to be returned Returns: a Patches instance for cleanup

func ApplyMethodSeq

func ApplyMethodSeq(target interface{}, methodName string, outputs []OutputCell) *Patches

ApplyMethodSeq applies a mock to a method with a sequence of outputs target: the target type methodName: name of the method to be mocked outputs: sequence of output values Returns: a Patches instance for cleanup

func ApplyPrivateMethod

func ApplyPrivateMethod(target interface{}, methodName string, double interface{}) *Patches

ApplyPrivateMethod applies a mock to a private method target: the target type methodName: name of the private method to be mocked double: the mock implementation Returns: a Patches instance for cleanup

Jump to

Keyboard shortcuts

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