package forwardplugin type PluginTypeMeta struct { Type string `json:"type"` Label string `json:"label"` Description string `json:"description"` ConfigSchema interface{} `json:"config_schema"` DefaultConfig interface{} `json:"default_config"` } func ListPluginTypes() []PluginTypeMeta { return []PluginTypeMeta{ { Type: "sub_filter", Label: "内容替换", Description: "按 MIME 类型对响应体做字符串替换", ConfigSchema: map[string]interface{}{ "filters": []map[string]string{{"from": "", "to": ""}}, "types": []string{"text/html"}, }, DefaultConfig: map[string]interface{}{ "filters": []map[string]string{{"from": "", "to": ""}}, "types": []string{"text/html"}, }, }, { Type: "inject_js", Label: "JS 注入", Description: "在 HTML 前注入脚本", ConfigSchema: map[string]interface{}{ "script": "", }, DefaultConfig: map[string]interface{}{ "script": "", }, }, { Type: "cookie_domain", Label: "Cookie 域改写", Description: "改写 Set-Cookie 的 Domain 属性", ConfigSchema: map[string]interface{}{ "from": "", "to": "", }, DefaultConfig: map[string]interface{}{ "from": ".example.com", "to": ".proxy.com", }, }, { Type: "response_cache", Label: "GET 响应缓存", Description: "缓存上游原始 GET 响应(不含 Set-Cookie)", ConfigSchema: map[string]interface{}{ "max_mb": 0, "ttl_sec": 300, }, DefaultConfig: map[string]interface{}{ "max_mb": 50, "ttl_sec": 300, }, }, } }