(r *gin.Engine, basicRes context.BasicRes, pluginName string, apiResources map[string]map[string]plugin.ApiResourceHandler)
| 98 | } |
| 99 | |
| 100 | func registerPluginEndpoints(r *gin.Engine, basicRes context.BasicRes, pluginName string, apiResources map[string]map[string]plugin.ApiResourceHandler) { |
| 101 | for resourcePath, resourceHandlers := range apiResources { |
| 102 | for method, h := range resourceHandlers { |
| 103 | r.Handle( |
| 104 | method, |
| 105 | fmt.Sprintf("/plugins/%s/%s", pluginName, resourcePath), |
| 106 | handlePluginCall(basicRes, pluginName, h), |
| 107 | ) |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | func handlePluginCall(basicRes context.BasicRes, pluginName string, handler plugin.ApiResourceHandler) func(c *gin.Context) { |
| 113 | return func(c *gin.Context) { |
no test coverage detected