MCPcopy Create free account
hub / github.com/wailsapp/wails / AddPluginScript

Method AddPluginScript

v2/pkg/assetserver/assetserver.go:99–107  ·  view source on GitHub ↗
(pluginName string, script string)

Source from the content-addressed store, hash-verified

97}
98
99func (d *AssetServer) AddPluginScript(pluginName string, script string) {
100 if d.pluginScripts == nil {
101 d.pluginScripts = make(map[string]string)
102 }
103 pluginName = strings.ReplaceAll(pluginName, "/", "_")
104 pluginName = html.EscapeString(pluginName)
105 pluginScriptName := fmt.Sprintf("/plugin_%s_%d.js", pluginName, rand.Intn(100000))
106 d.pluginScripts[pluginScriptName] = script
107}
108
109func (d *AssetServer) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
110 if isWebSocket(req) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected