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

Roadmap to v2 #141

Open
6 of 9 tasks
oschwald opened this issue Jun 30, 2024 · 2 comments
Open
6 of 9 tasks

Roadmap to v2 #141

oschwald opened this issue Jun 30, 2024 · 2 comments

Comments

@oschwald
Copy link
Owner

oschwald commented Jun 30, 2024

  • Replace net.IP and *net.IPNet with netip.Addr and netip.Prefix
  • Update naming and docs to more closely align with net/netip
  • Make SkipAliasedNetworks the default when traversing a tree. Almost no one wants the IPv4 information to be repeated in several spots. We will need to deal with SkipAliasedNetworks produces unexpected results on IPv6 trees without an IPv4 subtree #79 when doing this.
  • Replace LookupOffset with method that returns a struct rather than a uintptr. The returned value would have a Decode(any) method to replace the current use of (*Reader).Decode. Beyond the type safety and reducing the risk of a panic due to programmer error, this would provide the ability to do things like a DecodePath(result any, path ...any) that could avoid most of the use of reflection and creating a struct to decode to when looking up a single value.
  • (*Reader) Decode is removed. See above.
  • After the above changes, reexamine the Lookup* methods. Do we really need Lookup, LookupNetwork, and LookupOffset (or whatever the above replacement will be called)? Maybe the LookupOffset replacement method from above could replace all of them, although we would have to think about how error handling would work so as not to make it more verbose (e.g., defer returning error from the tree lookup).
  • Maybe rename FromBytes to OpenBytes or something as many people seem to overlook it.
  • Move decoder to a separate package to make PRs like this one more viable without creating a mess of the maxminddb package.
  • Maybe replace the existing Networks* traversal with an iterator.
@oschwald
Copy link
Owner Author

I have started this in v2 branch.

@oschwald oschwald mentioned this issue Jul 7, 2024
Merged
@oschwald
Copy link
Owner Author

oschwald commented Aug 18, 2024

I've released v2.0.0-beta.1. As mentioned in the release notes, I expect a final v2 release to be available after Go 1.24 is released. I've made most of the anticipated breaking changes, but it is likely there will be new breaking changes based on feedback.

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

No branches or pull requests

1 participant