Say a user uses the Go SDK and wants to "share" a Go function from their app to a plugin, making it an import to said plugin.
func logMessage(msg string) {
log.Println("from plugin:", msg)
}
func main() {
ext := extism.New()
plugin := ext.LoadPlugin(...)
// provide a handle to the function, adding some detail about
// what function to call, the "namespace" (module namespace
// to import from in wasm), the function name within wasm, and
// its params/returns
plugin.AddFunc(logMessage, "AcmeAppLib", "log", ...params) // tbd, how to declare the params/returns here
out, err := plugin.Call(...)
// ...
}
Say a user uses the Go SDK and wants to "share" a Go function from their app to a plugin, making it an import to said plugin.