-
Notifications
You must be signed in to change notification settings - Fork 40
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
Storage: local JSON file #123
Storage: local JSON file #123
Conversation
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.
Nice addition, had only a first look for cosmetic stuff, deeper look later
b0610fa
to
c991ce5
Compare
Linter complains:
|
I think there is nothing wrong with your approach, but have you considered using SQLite instead, this would also be a local storage solution but with all the downsides you mentioned fixed ? I started such a support back then, but havent enough time to finish that. |
b04d69a
to
d341382
Compare
Yeah my first thought was SQLite, but it would not advance in any meaningful way my use case of checking state into the repository in a human readable format. |
not sure what is this error |
d341382
to
dc7392d
Compare
dc7392d
to
bb6d2bd
Compare
PRs from outside the metal-stack org are not allowed to push to our registry, this is nothing to worry about. We where not able to implement this in the CI that the push is not executed in such a case. |
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #123 +/- ##
==========================================
- Coverage 64.85% 64.13% -0.73%
==========================================
Files 10 11 +1
Lines 1491 1656 +165
==========================================
+ Hits 967 1062 +95
- Misses 341 380 +39
- Partials 183 214 +31
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Nice, its still quite fast:
Can you add the filesytem backend into the Readme, skip the benchmark numbers for now. |
Done, I guess it highly depends on the backing storage and it currently lands on a ramdisk ( |
file.go
Outdated
data, err = json.Marshal(storage) | ||
} | ||
if err != nil { | ||
return err |
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.
Maybe give some contextual message to the error
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.
Thanks for the contribution !
This project seems like the only candidate so far to build a simple local IPAM (with "database" checked into git repository), but it was missing this type of storage, so I have implemented it as a local JSON file:
json.go
for serialization and deserialization of PrefixesIt is pretty barebones and could be improved, but should be good enough for easy evaluation of the project/library with persistence enabled.
some improvements I thought of: