code: func construct(name string, fn func(), minInterval, maxInterval time.Duration, burstRuns int, timer timer) *BoundedFrequencyRunner {
  	if maxInterval < minInterval {
  		panic(fmt.Sprintf("%s: maxInterval (%v) must be >= minInterval (%v)", name, minInterval, maxInterval))
  	}
  	if timer == nil {
  		panic(fmt.Sprintf("%s: timer must be non-nil", name))
  	}
  
  	bfr := &BoundedFrequencyRunner{
  		name:        name,
  		fn:          fn,
  		minInterval: minInterval,
  		maxInterval: maxInterval,
  		run:         make(chan struct{}, 1),
  		timer:       timer,
  	}
  	if minInterval == 0 {
  		bfr.limiter = nullLimiter{}
  	} else {
  		// allow burst updates in short succession
  		qps := float32(time.Second) / float32(minInterval)
  		bfr.limiter = flowcontrol.NewTokenBucketRateLimiterWithClock(qps, burstRuns, timer)
  	}
  	return bfr
  }
docs: // Make an instance with dependencies injected.