Files
server/plugin/storagehandler.go
eternal-flame-AD e5b24f4c92 Add plugin feature
Fixed database migration
Added a plugin system based on the go plugin package
2019-02-09 12:52:01 +01:00

17 lines
343 B
Go

package plugin
type dbStorageHandler struct {
pluginID uint
db Database
}
func (c dbStorageHandler) Save(b []byte) error {
conf := c.db.GetPluginConfByID(c.pluginID)
conf.Storage = b
return c.db.UpdatePluginConf(conf)
}
func (c dbStorageHandler) Load() ([]byte, error) {
return c.db.GetPluginConfByID(c.pluginID).Storage, nil
}