[wip] refactor: config management #1239
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[generated by github copilot]
This pull request introduces a new configuration parser, updates configuration files, and modifies test setup and dependencies. The most important changes include the addition of a new
ConfigParser
inconfig/parser.go
, updates to configuration files, and adjustments in test setup and dependency management.Configuration Management:
config/parser.go
: Added a newConfigParser
to handle parsing configuration files and unmarshalling configuration values into structs. This parser supports reading from files, stdin, and setting default values.Configuration Files:
dice.conf
: Added a new configuration file for Dicedb with various settings including server, HTTP, WebSocket, performance, memory, persistence, logging, authentication, and network configurations.dice.toml
: Removed the old TOML configuration file that included similar settings to the newdice.conf
file.Dependency Management:
go.mod
: Removed several indirect dependencies and addedgithub.com/kr/pretty
as a new indirect dependency. [1] [2]Test Setup Adjustments:
integration_tests/commands/http/setup.go
: Updated the HTTP server setup to use the new configuration structure.integration_tests/commands/websocket/setup.go
: Updated the WebSocket server setup to use the new configuration structure.Test Improvements:
integration_tests/commands/websocket/json_test.go
: Added missing error assertions in theTestJsonARRTRIM
andTestJsonARRINSERT
tests. [1] [2]integration_tests/config/config_test.go
: Commented out old test cases and added a placeholder for new tests to be implemented.