code: func New(manager *plugins.Manager, opts ...func(*Discovery)) (*Discovery, error) {
  
  	result := &Discovery{
  		manager: manager,
  	}
  
  	for _, f := range opts {
  		f(result)
  	}
  
  	config, err := ParseConfig(manager.Config.Discovery, manager.Services())
  
  	if err != nil {
  		return nil, err
  	} else if config == nil {
  		if _, err := getPluginSet(result.factories, manager, manager.Config); err != nil {
  			return nil, err
  		}
  		return result, nil
  	}
  
  	if manager.Config.PluginsEnabled() {
  		return nil, fmt.Errorf("plugins cannot be specified in the bootstrap configuration when discovery enabled")
  	}
  
  	result.config = config
  	result.downloader = download.New(config.Config, manager.Client(config.service), config.path).WithCallback(result.oneShot)
  	result.status = &bundle.Status{
  		Name: *config.Name,
  	}
  
  	return result, nil
  }
docs: // New returns a new discovery plugin.