code: func NewManager(cfg ManagerConfig) (*Manager, error) {
  	if cfg.Cache == nil || cfg.State == nil || cfg.Source == nil ||
  		cfg.Logger == nil {
  		return nil, errors.New("all ManagerConfig fields must be provided")
  	}
  	m := &Manager{
  		ManagerConfig: cfg,
  		// Single item buffer is enough since there is no data transferred so this
  		// is "level triggering" and we can't miss actual data.
  		stateCh:  make(chan struct{}, 1),
  		proxies:  make(map[string]*state),
  		watchers: make(map[string]map[uint64]chan *ConfigSnapshot),
  	}
  	return m, nil
  }
docs: // NewManager constructs a manager from the provided agent cache.