MCPcopy Create free account
hub / github.com/gotify/server / GetPluginConfByUserAndPath

Method GetPluginConfByUserAndPath

database/plugin.go:19–29  ·  view source on GitHub ↗

GetPluginConfByUserAndPath gets plugin configuration by user and file name.

(userid uint, path string)

Source from the content-addressed store, hash-verified

17
18// GetPluginConfByUserAndPath gets plugin configuration by user and file name.
19func (d *GormDatabase) GetPluginConfByUserAndPath(userid uint, path string) (*model.PluginConf, error) {
20 plugin := new(model.PluginConf)
21 err := d.DB.Where("user_id = ? AND module_path = ?", userid, path).First(plugin).Error
22 if err == gorm.ErrRecordNotFound {
23 err = nil
24 }
25 if plugin.ModulePath == path {
26 return plugin, err
27 }
28 return nil, err
29}
30
31// GetPluginConfByApplicationID gets plugin configuration by its internal appid.
32func (d *GormDatabase) GetPluginConfByApplicationID(appid uint) (*model.PluginConf, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected