-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add support for more data structures #7
Comments
Hi, thanks for the request! I am in favor of adding another data structure to When it comes to adding the code in a separate package, I agree with the advantage of typing To answer your questions:
If you have further plans for additional data structures, having a more feature rich package (perhaps based on simplebolt) could be a nice idea. If not, I would happily accept the proposed changes to simplebolt. Best regards, |
I looked at this again today, and merged in your branch. Thanks! |
The cyclomatic complexity is a bit high: https://goreportcard.com/report/github.com/xyproto/simplebolt Other than that, the merge looks good and all tests pass. |
I really like the idea of storing data in Bolt's b+tree with a slightly different behaviour and API. I think that was your initial goal with simpebolt, along with providing an easy to use API to interact with bbolt.
I would like to collaborate on expanding the available data structures, starting with a doubly linked list like the one at the stdlib.
Although I like the way the data units are related one another, I find it hard to think of a real world example in which an in-memory data structure such as the doubly linked list would be really useful. It's somewhat easier to think of a real world use case of data structures if they're persisted on some sort of database.
I actually have already implemented a doubly linked list, as you can see in my fork of your repo: https://github.com/villegasl/simplebolt/blob/master/linkedlist/linkedlist.go.
I took another approach regarding the organization of the data structures: instead of having the definition of every data structure in a single package, I found it better to encapsulate them in different packages, in this case, package linkedlist. That way, if you want to create a new linkedlist, you'd call:
linkedlist.New(db, "my_ll")
instead ofsimplebolt.NewLinkedList(db, "my_ll)
. I also made a few different decisions about the interface design. I can talk about every change and feature I added so far in a pull request if you are agree.It is ready to be merged from a pull request, but before I create a PR, I'd like to ask you a couple questions:
Have you already used this library in production, or do you know of some project that's using it?
What are your expectations about the scope of this library? or more specifically, can you think of a real-world application example, say, in a web application?
I would love to help and learn along the way.
The text was updated successfully, but these errors were encountered: