code: func (ssa *SQLStorageAuthority) CountRegistrationsByIP(ctx context.Context, ip net.IP, earliest time.Time, latest time.Time) (int, error) {
  	var count int64
  	err := ssa.dbMap.WithContext(ctx).SelectOne(
  		&count,
  		`SELECT COUNT(1) FROM registrations
  		 WHERE
  		 initialIP = :ip AND
  		 :earliest < createdAt AND
  		 createdAt <= :latest`,
  		map[string]interface{}{
  			"ip":       []byte(ip),
  			"earliest": earliest,
  			"latest":   latest,
  		})
  	if err != nil {
  		return -1, err
  	}
  	return int(count), nil
  }
docs: // CountRegistrationsByIP returns the number of registrations created in the
  // time range for a single IP address.