package discovery

import 

// DiscoveryOpt is a single discovery option.
type Option func(opts *Options) error

// DiscoveryOpts is a set of discovery options.
type Options struct {
	Ttl   time.Duration
	Limit int

	// Other (implementation-specific) options
	Other map[interface{}]interface{}
}

// Apply applies the given options to this DiscoveryOpts
func ( *Options) ( ...Option) error {
	for ,  := range  {
		if  := ();  != nil {
			return 
		}
	}
	return nil
}

// TTL is an option that provides a hint for the duration of an advertisement
func ( time.Duration) Option {
	return func( *Options) error {
		.Ttl = 
		return nil
	}
}

// Limit is an option that provides an upper bound on the peer count for discovery
func ( int) Option {
	return func( *Options) error {
		.Limit = 
		return nil
	}
}