feat(config): restructures config
This commit is contained in:
parent
65a393f8d6
commit
f0be9c42d3
10 changed files with 71 additions and 59 deletions
|
|
@ -174,7 +174,7 @@ func (s *Store) parseDB(v string, defaults bool) (string, error) {
|
|||
}
|
||||
if db == "" {
|
||||
if defaults {
|
||||
return config.DefaultDB, nil
|
||||
return config.Store.DefaultStoreName, nil
|
||||
}
|
||||
return "", fmt.Errorf("cannot parse db: bad db format, use DB or @DB")
|
||||
}
|
||||
|
|
@ -186,7 +186,7 @@ func (s *Store) parseDB(v string, defaults bool) (string, error) {
|
|||
|
||||
func (s *Store) open(name string) (*badger.DB, error) {
|
||||
if name == "" {
|
||||
name = config.DefaultDB
|
||||
name = config.Store.DefaultStoreName
|
||||
}
|
||||
path, err := s.path(name)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue