-
Notifications
You must be signed in to change notification settings - Fork 233
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
feat: move options to main package and make internals private #486
Conversation
Rational: 1. This allows us to make private options for testing. 2. This removes an import for DHT users. 3. This makes options much easier to discover. 4. This makes it possible to make the config/options internals private. We originally put them in a sub-package to avoid poluting the root namespace, but that isn't really necessary. This keeps the old package (for now) to avoid breaking too much.
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.
LGTM, left a couple small comments.
opts/options.go
Outdated
"github.com/libp2p/go-libp2p-record" | ||
) | ||
|
||
// Deprecated: The old format did not support more than one message per stream, and is not supported | ||
// or relevant with stream pooling. ProtocolDHT should be used instead. | ||
const ProtocolDHTOld protocol.ID = "/ipfs/dht" | ||
const ProtocolDHTOld = dht.ProtocolDHTOld |
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.
Do we need this at all? I was thinking of removing it in #479, could kill it there since it might be more appropriate.
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.
Note: we're going to have to refactor this anyways when we fix protocol string handling.
df53f8d
to
2e10782
Compare
@aschmahmann I'll leave merging this to you. |
* feat: move options to main package and make internals private Rationale: 1. This allows us to make private options for testing. 2. This removes an import for DHT users. 3. This makes options much easier to discover. 4. This makes it possible to make the config/options internals private. We originally put them in a sub-package to avoid poluting the root namespace, but that isn't really necessary. This keeps the old package (for now) to avoid breaking too much.
* feat: move options to main package and make internals private Rationale: 1. This allows us to make private options for testing. 2. This removes an import for DHT users. 3. This makes options much easier to discover. 4. This makes it possible to make the config/options internals private. We originally put them in a sub-package to avoid poluting the root namespace, but that isn't really necessary. This keeps the old package (for now) to avoid breaking too much.
Rational:
We originally put them in a sub-package to avoid poluting the root namespace,
but that isn't really necessary.
This keeps the old package (for now) to avoid breaking too much.