dynamiclib_caller

package
v0.0.0-...-b6d7cd6 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 4 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

This section is empty.

Types

type DynlibCaller

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

DynlibCaller 用于调用动态库中的函数 主要职责:连接 loader 和 function binding

func NewDynlibCaller

func NewDynlibCaller(libPath string, funsName []string) (*DynlibCaller, error)

NewDynlibCaller 创建一个新的动态库函数调用器

func (*DynlibCaller) BindFunction

func (d *DynlibCaller) BindFunction(dynFunName string, fn any) error

BindFunction 绑定动态库中的函数到 Go 函数指针 dynFunName 是动态库中的函数名 fn 是指向函数类型的指针,例如:var addFunc func(int, int) int; BindFunction("add", &addFunc)

func (*DynlibCaller) InjectFunction

func (d *DynlibCaller) InjectFunction(recvFuncName string, fn any) error

InjectFunction 注入 Go 函数作为回调到动态库中 recvFuncName 是动态库中用于接收回调函数的函数名 fn 是要注入的 Go 函数

func (*DynlibCaller) Release

func (d *DynlibCaller) Release() error

type DynlibLoader

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

DynlibLoader 用于加载动态库文件的组件

func NewDynlibLoader

func NewDynlibLoader(libPath string, requiredFuncs []string) (*DynlibLoader, error)

NewDynlibLoader 创建一个新的动态库加载器

func (*DynlibLoader) GetFunctionPointer

func (d *DynlibLoader) GetFunctionPointer(funcName string) (uintptr, error)

func (*DynlibLoader) Release

func (d *DynlibLoader) Release() error

Jump to

Keyboard shortcuts

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