hook

package
v0.0.0-...-8c53acf Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearHooks

func ClearHooks()

func NodeId

func NodeId(n ast.Node, file string, fSet *token.FileSet) *ast.BasicLit

func RegisterDefaultHooks

func RegisterDefaultHooks(disabledSanitizers []string)

func RegisterFunctionHook

func RegisterFunctionHook(functionName, packagePath, hookName string)

func RegisterMethodHook

func RegisterMethodHook(methodName, receiverType, hookName string)

func SetSanitizersPackagePath

func SetSanitizersPackagePath(pkgPath string)

Types

type FunctionHook

type FunctionHook struct {
	FunctionName string
	PackagePath  string
	HookName     string
}

func MatchingFunctionHook

func MatchingFunctionHook(function, pkg string) *FunctionHook

type Hooks

type Hooks struct {
	Functions []FunctionHook
	Methods   []MethodHook
}

type IdFunction

type IdFunction = func(n ast.Node, file string, fSet *token.FileSet) *ast.BasicLit

type MethodHook

type MethodHook struct {
	MethodName   string
	ReceiverType string
	HookName     string
}

func MatchingMethodHook

func MatchingMethodHook(method, receiverType string) *MethodHook

type Transformer

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

func NewTransformer

func NewTransformer(file *ast.File, fileSet *token.FileSet, filePath string, typeInfo *types.Info, hookIdFn IdFunction) *Transformer

func (*Transformer) TransformFile

func (t *Transformer) TransformFile() int

Jump to

Keyboard shortcuts

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