Files
filebrowser/bolt/config.go
Henrique Dias 5b619337df Almost working!
2017-08-20 08:42:38 +01:00

24 lines
412 B
Go

package bolt
import (
"github.com/asdine/storm"
fm "github.com/hacdias/filemanager"
)
type ConfigStore struct {
DB *storm.DB
}
func (c ConfigStore) Get(name string, to interface{}) error {
err := c.DB.Get("config", name, to)
if err == storm.ErrNotFound {
return fm.ErrNotExist
}
return err
}
func (c ConfigStore) Save(name string, from interface{}) error {
return c.DB.Set("config", name, from)
}