GetPluginConfByToken gets plugin configuration by plugin token.
(token string)
| 48 | |
| 49 | // GetPluginConfByToken gets plugin configuration by plugin token. |
| 50 | func (d *GormDatabase) GetPluginConfByToken(token string) (*model.PluginConf, error) { |
| 51 | plugin := new(model.PluginConf) |
| 52 | err := d.DB.Where("token = ?", token).First(plugin).Error |
| 53 | if err == gorm.ErrRecordNotFound { |
| 54 | err = nil |
| 55 | } |
| 56 | if plugin.Token == token { |
| 57 | return plugin, err |
| 58 | } |
| 59 | return nil, err |
| 60 | } |
| 61 | |
| 62 | // GetPluginConfByID gets plugin configuration by plugin ID. |
| 63 | func (d *GormDatabase) GetPluginConfByID(id uint) (*model.PluginConf, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected