You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EIP: calling user defined functions from SDK host #5
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.
funclogMessage(msgstring) {
log.Println("from plugin:", msg)
}
funcmain() {
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/returnsplugin.AddFunc(logMessage, "AcmeAppLib", "log", ...params) // tbd, how to declare the params/returns hereout, err:=plugin.Call(...)
// ...
}
Activity
nilslice commentedon Aug 12, 2022
Created EIP-004-providing-sdk-user-defined-functions.md.
joepio commentedon Dec 6, 2022
this would be very useful indeed! I submitted a similar issue to fp_bindgen.