mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
29 lines
659 B
Go
29 lines
659 B
Go
package bolt
|
|
|
|
import (
|
|
"github.com/asdine/storm"
|
|
"github.com/filebrowser/filebrowser/v2/settings"
|
|
)
|
|
|
|
type settingsBackend struct {
|
|
db *storm.DB
|
|
}
|
|
|
|
func (s settingsBackend) Get() (*settings.Settings, error) {
|
|
settings := &settings.Settings{}
|
|
return settings, get(s.db, "settings", settings)
|
|
}
|
|
|
|
func (s settingsBackend) Save(settings *settings.Settings) error {
|
|
return save(s.db, "settings", settings)
|
|
}
|
|
|
|
func (s settingsBackend) GetServer() (*settings.Server, error) {
|
|
server := &settings.Server{}
|
|
return server, get(s.db, "server", server)
|
|
}
|
|
|
|
func (s settingsBackend) SaveServer(server *settings.Server) error {
|
|
return save(s.db, "server", server)
|
|
}
|