-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify configs package #1032
Simplify configs package #1032
Conversation
@@ -33,13 +33,13 @@ func initDependencies() (*dependencies, error) { | |||
} | |||
|
|||
// init services db. | |||
serviceDB, err := database.NewServiceDB(filepath.Join(config.Core.Path, config.Core.Database.ServiceRelativePath)) | |||
serviceDB, err := database.NewServiceDB(filepath.Join(config.Path, config.Database.ServiceRelativePath)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config.Database.ServiceRelativePath should already contain config.Path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the end it makes sense to keep config.Path
out of config.Database.XXXXRelativePath
so by only modifiying config.Path
, it will change all other path that use this folder.
The user doesn't need to know all sub-folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I want to avoid is the fact that other package needs to modify configs path. In that case, only config package manages paths etc... What you wrote is true also when config package joins paths.
To be clear I don't want a user to specify the full path for the database. I want to move a join call into config package.
I know we have this in the previous version of engine, but it could be refactored and clear a bit if :)
I moved |
Closes #1021
This PR simplify the config package by removing config that were used by the cli, flatten the Core struct, and make the Engine work with default value!