Source File
options.go
Belonging Package
github.com/libp2p/go-libp2p/core/discovery
package discoveryimport// DiscoveryOpt is a single discovery option.type Option func(opts *Options) error// DiscoveryOpts is a set of discovery options.type Options struct {Ttl time.DurationLimit int// Other (implementation-specific) optionsOther map[interface{}]interface{}}// Apply applies the given options to this DiscoveryOptsfunc ( *Options) ( ...Option) error {for , := range {if := (); != nil {return}}return nil}// TTL is an option that provides a hint for the duration of an advertisementfunc ( time.Duration) Option {return func( *Options) error {.Ttl =return nil}}// Limit is an option that provides an upper bound on the peer count for discoveryfunc ( int) Option {return func( *Options) error {.Limit =return nil}}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |