go-libp2p-core/discovery/options.go

28 lines
843 B
Go
Raw Normal View History

package discovery
2022-08-18 23:54:48 +08:00
import (
"time"
"github.com/libp2p/go-libp2p/core/discovery"
)
// DiscoveryOpt is a single discovery option.
2022-08-18 23:54:48 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/core/discovery.Option instead
type Option = discovery.Option
// DiscoveryOpts is a set of discovery options.
2022-08-18 23:54:48 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/core/discovery.Options instead
type Options = discovery.Options
// TTL is an option that provides a hint for the duration of an advertisement
2022-08-18 23:54:48 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/core/discovery.TTL instead
func TTL(ttl time.Duration) Option {
2022-08-18 23:54:48 +08:00
return discovery.TTL(ttl)
}
// Limit is an option that provides an upper bound on the peer count for discovery
2022-08-18 23:54:48 +08:00
// Deprecated: use github.com/libp2p/go-libp2p/core/discovery.Limit instead
func Limit(limit int) Option {
2022-08-18 23:54:48 +08:00
return discovery.Limit(limit)
}