func (l ipThrottle) Recent(ip string, timeFrame time.Duration) int {
	valid := 0
	var removing []string
	if attempts, ok := l[strutil.IPToInteger(ip).String()]; ok {
		for _, v := range attempts {
			if time.Since(v) < timeFrame {
				valid++
				continue
			}
			removing = append(removing, ip)
		}
		for i := range removing {
			if i == len(attempts) {
				l[strutil.IPToInteger(ip).String()] = attempts[:i]
			} else {
				l[strutil.IPToInteger(ip).String()] = append(attempts[:i], attempts[i+1:]...)
			}
		}
	}
	return valid
}
Recent returns the number of entries that match the provided IP which were added within the past specified timeFrame
package ipThrottle
import (
	"net"
	"time"
	"github.com/spkaeros/rscgo/pkg/strutil"
)
type ipThrottle map[string][]time.Time
func (l ipThrottle) Add(ip string) {
	l[net.ParseIP(ip).String()] = append(l[strutil.IPToInteger(ip).String()], time.Now())
}