refactor(web): start Go ABI rewrite of plugins/web (W-G0)
Archive the Rust web plugin and add a Go c-shared skeleton with ABI v2 bridge, build script, design doc/ADR, and smoke test so multi-language plugins and full web parity can proceed wave by wave. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
fb6254e501
commit
ca40c698a2
42 files changed
+955
-3
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package plugin
|
||||
|
||||
// HostFns holds callbacks into the Marqdo host (valid after marqdo_plugin_init).
|
||||
type HostFns struct {
|
||||
Query func(name, argsJSON string) (string, error)
|
||||
}
|
||||
|
||||
var host HostFns
|
||||
|
||||
// SetHost stores host callbacks from ABI init.
|
||||
func SetHost(h HostFns) { host = h }
|
||||
|
||||
// Shutdown clears plugin global state (HTTP servers, pools, …).
|
||||
func Shutdown() {
|
||||
host = HostFns{}
|
||||
}
|
||||
|
||||
// Query runs an allowlisted host_query.
|
||||
func Query(name, argsJSON string) (string, error) {
|
||||
if host.Query == nil {
|
||||
return "", errString("host_query not available")
|
||||
}
|
||||
return host.Query(name, argsJSON)
|
||||
}
|
||||
|
||||
type errString string
|
||||
|
||||
func (e errString) Error() string { return string(e) }
|
||||
Reference in new issue
Block a user