proxyserver

This commit is contained in:
eson
2023-10-09 14:41:57 +08:00
parent 12a6e95a11
commit 9fdc5b4dbf
10 changed files with 94 additions and 61 deletions

View File

@@ -15,9 +15,9 @@ type TimeLimit[T comparable] struct {
dur time.Duration
}
// NewTimelimit构造函数,接收限频的时间间隔
// NewTimeLimit构造函数,接收限频的时间间隔
// 并初始化内部字典和间隔字段
func NewTimelimit[T comparable](dur time.Duration) *TimeLimit[T] {
func NewTimeLimit[T comparable](dur time.Duration) *TimeLimit[T] {
return &TimeLimit[T]{
dict: make(map[T]struct{}),
dur: dur,