feat(web): serve upload, WS, proxy, and gallery on Go listen
Mount media/ws/proxy/invoke routes in httpx, force gold onto Go via MARQDO_WEB_PLUGIN, and case-fold middleware header checks so all seven web live golds pass against libweb.so. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
c4a726397d
commit
e20cf8b386
13 files changed
+1481
-39
No files matched your search
@@ -1,5 +1,7 @@
|
||||
package plugin
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// HostFns holds callbacks into the Marqdo host (valid after marqdo_plugin_init).
|
||||
type HostFns struct {
|
||||
Query func(name, argsJSON string) (string, error)
|
||||
@@ -26,3 +28,24 @@ func Query(name, argsJSON string) (string, error) {
|
||||
type errString string
|
||||
|
||||
func (e errString) Error() string { return string(e) }
|
||||
|
||||
// CallLibPath invokes `lib.member` on the site entry module (optional named args).
|
||||
func CallLibPath(path string, args map[string]any) (any, error) {
|
||||
payload := map[string]any{"path": path}
|
||||
if len(args) > 0 {
|
||||
payload["args"] = args
|
||||
}
|
||||
raw, err := json.Marshal(payload)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out, err := Query("call_lib_path", string(raw))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var v any
|
||||
if err := json.Unmarshal([]byte(out), &v); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return v, nil
|
||||
}
|
||||
Reference in new issue
Block a user