Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FuncPatcher ¶
FuncPatcher To apply function hot patching.
func GoMonkey ¶
func GoMonkey() FuncPatcher
GoMonkey Hot patching implementation based on monkey-patching.
type FuncPicker ¶
type FuncPicker func(dwarfAssembly assembly.DwarfAssembly) ([]string, error)
FuncPicker List of functions that need to be hotfix.
func Classes ¶
func Classes(classNames ...string) FuncPicker
Classes To fix a specified class or classes (all member functions), the fully qualified name of the class must be used.
example/data.DataType *example/data.DataType
func Func ¶
func Func(funcNames ...string) FuncPicker
Func to specify one or more functions, you must use the full qualified name of the function.
example/data.TestAdd example/data.(*DataType).TestHotfix example/data.testPrivateFunc example/data.(*DataType).test
func Package ¶
func Package(pkgs ...string) FuncPicker
Package To fix all export, private, and member functions in one or more packages, the full package name must be used
example/data
type Request ¶
type Request struct {
Logger *log.Logger // Debug logger.
Patch string // Plugin file.
ThreadSafe bool // Whether it is thread safe.
Methods []string // Patching function list.
Assembly assembly.DwarfAssembly // Go runtime assembly.
OldFuncEntrys []*proc.Function // Old function entrys.
OldFunctions []reflect.Value // Old function values.
NewFunctions []reflect.Value // Plugin function values.
}
type Result ¶
type Result struct {
Assembly assembly.DwarfAssembly
Patch string // Plugin file
ThreadSafe bool // Whether it is thread safe, the default is false, use stw mechanism to ensure thread safety.
Methods []string // Patching function list.
Cost time.Duration // Total of cost time.
Err error // Patching failed reason.
Message string // Patching debug message.
}
func DoHotfix ¶
func DoHotfix(libPath string, funcPicker FuncPicker, funcPatcher FuncPatcher, threadSafe ...bool) (result Result)
DoHotfix Apply hot patching in a custom way.
Click to show internal directories.
Click to hide internal directories.