MCPcopy
hub / github.com/gotify/server / GetDisplay

Method GetDisplay

api/plugin.go:242–259  ·  view source on GitHub ↗

GetDisplay get display info for Displayer plugin. swagger:operation GET /plugin/{id}/display plugin getPluginDisplay Get display info for a Displayer plugin. --- consumes: [application/json] produces: [application/json] parameters: - name: id in: path description: the plugin id requi

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

240// schema:
241// $ref: "#/definitions/Error"
242func (c *PluginAPI) GetDisplay(ctx *gin.Context) {
243 withID(ctx, "id", func(id uint) {
244 conf, err := c.DB.GetPluginConfByID(id)
245 if success := successOrAbort(ctx, 500, err); !success {
246 return
247 }
248 if conf == nil || !isPluginOwner(ctx, conf) {
249 ctx.AbortWithError(404, errors.New("unknown plugin"))
250 return
251 }
252 instance, err := c.Manager.Instance(id)
253 if err != nil {
254 ctx.AbortWithError(404, errors.New("plugin instance not found"))
255 return
256 }
257 ctx.JSON(200, instance.GetDisplay(location.Get(ctx)))
258 })
259}
260
261// GetConfig returns Configurer plugin configuration in YAML format.
262// swagger:operation GET /plugin/{id}/config plugin getPluginConfig

Callers

nothing calls this directly

Calls 6

withIDFunction · 0.85
successOrAbortFunction · 0.85
isPluginOwnerFunction · 0.85
InstanceMethod · 0.80
GetPluginConfByIDMethod · 0.65
GetDisplayMethod · 0.65

Tested by

no test coverage detected