filebrowser/storage/bolt/utils.go
2019-01-05 22:44:33 +00:00

20 lines
376 B
Go

package bolt
import (
"github.com/asdine/storm"
"github.com/filebrowser/filebrowser/v2/errors"
)
func get(db *storm.DB, name string, to interface{}) error {
err := db.Get("config", name, to)
if err == storm.ErrNotFound {
return errors.ErrNotExist
}
return err
}
func save(db *storm.DB, name string, from interface{}) error {
return db.Set("config", name, from)
}