mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
20 lines
376 B
Go
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)
|
||
|
}
|