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: 0

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