Skip to content
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

refactor(storage): leveldb initialization and dependency handling #782

Merged
merged 1 commit into from
Jun 16, 2024

Conversation

appleboy
Copy link
Owner

  • Refactor leveldb.New initialization to accept dbPath instead of config
  • Add os package import in leveldb.go
  • Remove config dependency from leveldb package
  • Replace config field with dbPath in Storage struct
  • Simplify locking mechanism by directly using sync.RWMutex methods
  • Add default dbPath handling in Init method if dbPath is empty
  • Update leveldb_test.go to use new New function signature
  • Add test assertions to reset and verify key values in leveldb_test.go

- Refactor `leveldb.New` initialization to accept `dbPath` instead of `config`
- Add `os` package import in `leveldb.go`
- Remove `config` dependency from `leveldb` package
- Replace `config` field with `dbPath` in `Storage` struct
- Simplify locking mechanism by directly using `sync.RWMutex` methods
- Add default `dbPath` handling in `Init` method if `dbPath` is empty
- Update `leveldb_test.go` to use new `New` function signature
- Add test assertions to reset and verify key values in `leveldb_test.go`

Signed-off-by: appleboy <appleboy.tw@gmail.com>
@appleboy appleboy merged commit 005aa23 into master Jun 16, 2024
10 checks passed
@appleboy appleboy deleted the leveldb branch June 16, 2024 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant