Commit a288d2c9 authored by Łukasz Magiera's avatar Łukasz Magiera Committed by Steven Allen

coreapi: dht: remove option prefix

License: MIT
Signed-off-by: default avatarŁukasz Magiera <magik6k@gmail.com>
parent 03a210bb
...@@ -43,18 +43,18 @@ type dhtOpts struct{} ...@@ -43,18 +43,18 @@ type dhtOpts struct{}
var Dht dhtOpts var Dht dhtOpts
// WithRecursive is an option for Dht.Provide which specifies whether to provide // Recursive is an option for Dht.Provide which specifies whether to provide
// the given path recursively // the given path recursively
func (dhtOpts) WithRecursive(recursive bool) DhtProvideOption { func (dhtOpts) Recursive(recursive bool) DhtProvideOption {
return func(settings *DhtProvideSettings) error { return func(settings *DhtProvideSettings) error {
settings.Recursive = recursive settings.Recursive = recursive
return nil return nil
} }
} }
// WithNumProviders is an option for Dht.FindProviders which specifies the // NumProviders is an option for Dht.FindProviders which specifies the
// number of peers to look for. Default is 20 // number of peers to look for. Default is 20
func (dhtOpts) WithNumProviders(numProviders int) DhtFindProvidersOption { func (dhtOpts) NumProviders(numProviders int) DhtFindProvidersOption {
return func(settings *DhtFindProvidersSettings) error { return func(settings *DhtFindProvidersSettings) error {
settings.NumProviders = numProviders settings.NumProviders = numProviders
return nil return nil
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment