mpatch

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 6 Imported by: 8

README

go-mpatch

Go library for monkey patching

Library inspired by the blog post: https://bou.ke/blog/monkey-patching-in-go/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Patch

type Patch struct {
	// contains filtered or unexported fields
}

func PatchInstanceMethodByName

func PatchInstanceMethodByName(target reflect.Type, methodName string, redirection interface{}) (*Patch, error)

func PatchMethod

func PatchMethod(target, redirection interface{}) (*Patch, error)

func PatchMethodByReflect

func PatchMethodByReflect(target reflect.Method, redirection interface{}) (*Patch, error)

func PatchMethodWithMakeFunc

func PatchMethodWithMakeFunc(target reflect.Method, fn func(args []reflect.Value) (results []reflect.Value)) (*Patch, error)

func (*Patch) Patch

func (p *Patch) Patch() error

func (*Patch) Unpatch

func (p *Patch) Unpatch() error

Jump to

Keyboard shortcuts

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