-
Notifications
You must be signed in to change notification settings - Fork 228
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
Move coord packages to internal #933
Conversation
|
||
import "fmt" | ||
|
||
// A ConfigurationError is returned when a component's configuration is found to be invalid or unusable. |
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.
I think we should be using typed errors throughout so I brought this over from go-kademlia
"github.com/libp2p/go-libp2p-kad-dht/v2/coord" | ||
"github.com/libp2p/go-libp2p-kad-dht/v2/coord/routing" | ||
"github.com/libp2p/go-libp2p-kad-dht/v2/kadt" | ||
"github.com/libp2p/go-libp2p-kad-dht/v2/internal/coord/routing" |
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.
Used for the Routing Table. I need to replicate the necessary interface here
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.
Defined interface in kadt package since it is part of the bridge between libp2p and go-kademlia types
Had to move kadt back out of internal since the RoutingTable uses kadt.Key and kadt.PeerID so clients supplying their own routing table implementation need access to those types too. |
* Improve query capabilities * go mod tidy * Review feedback * go mod tidy * Move coord packages to internal (#933) * Move coord and kadt packages to internal * go mod tidy * go fmt * Move kadt out of internal and add RoutingTable interface
* Improve query capabilities * go mod tidy * Review feedback * go mod tidy * Move coord packages to internal (#933) * Move coord and kadt packages to internal * go mod tidy * go fmt * Move kadt out of internal and add RoutingTable interface * Add explore state machine to expand population of routing table * Refactor schedule into separate type * Add generation of random peer id for a given cpl * go mod tidy * Add prefixmap generator * Use constants for various query ids * go mod tidy * Wire explore state machine into routing behaviour * Remove some unnecessary conversions * PR review updates
Moved coord and sub packages to internal to reduce API surface and allow more radical refactoring in the future.
Need to double-check that no internal types are expected in method signatures or return values in the v2 root packageBranched from #932 since that touched a lot of the same packages