mirror of
https://github.com/xiaoqidun/limit.git
synced 2026-01-01 20:03:53 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ed76bfe6ab | |||
| cdf7396e91 | |||
| c3e04c1cc6 |
2
LICENSE
2
LICENSE
@@ -186,7 +186,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright 2025 肖其顿
|
Copyright 2025 肖其顿 (XIAO QI DUN)
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
16
NOTICE
16
NOTICE
@@ -1,13 +1,5 @@
|
|||||||
Copyright 2025 肖其顿
|
limit
|
||||||
|
Copyright 2025 肖其顿 (XIAO QI DUN)
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
This product includes software developed by
|
||||||
you may not use this file except in compliance with the License.
|
肖其顿 (XIAO QI DUN) (https://github.com/xiaoqidun/limit).
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2025 肖其顿
|
// Copyright 2025 肖其顿 (XIAO QI DUN)
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
|
|||||||
4
go.mod
4
go.mod
@@ -1,5 +1,5 @@
|
|||||||
module github.com/xiaoqidun/limit
|
module github.com/xiaoqidun/limit
|
||||||
|
|
||||||
go 1.25.1
|
go 1.25.3
|
||||||
|
|
||||||
require golang.org/x/time v0.13.0
|
require golang.org/x/time v0.14.0
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -1,2 +1,2 @@
|
|||||||
golang.org/x/time v0.13.0 h1:eUlYslOIt32DgYD6utsuUeHs4d7AsEYLuIAdg7FlYgI=
|
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
|
||||||
golang.org/x/time v0.13.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
||||||
|
|||||||
6
limit.go
6
limit.go
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2025 肖其顿
|
// Copyright 2025 肖其顿 (XIAO QI DUN)
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
@@ -265,14 +265,14 @@ type session struct {
|
|||||||
|
|
||||||
// sessionPool 使用 sync.Pool 来复用 session 对象,以减少 GC 压力。
|
// sessionPool 使用 sync.Pool 来复用 session 对象,以减少 GC 压力。
|
||||||
var sessionPool = sync.Pool{
|
var sessionPool = sync.Pool{
|
||||||
New: func() interface{} {
|
New: func() any {
|
||||||
return new(session)
|
return new(session)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// fnvHasherPool 使用 sync.Pool 来复用 FNV-1a 哈希对象,以减少高并发下的内存分配。
|
// fnvHasherPool 使用 sync.Pool 来复用 FNV-1a 哈希对象,以减少高并发下的内存分配。
|
||||||
var fnvHasherPool = sync.Pool{
|
var fnvHasherPool = sync.Pool{
|
||||||
New: func() interface{} {
|
New: func() any {
|
||||||
return fnv.New32a()
|
return fnv.New32a()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2025 肖其顿
|
// Copyright 2025 肖其顿 (XIAO QI DUN)
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
// you may not use this file except in compliance with the License.
|
// you may not use this file except in compliance with the License.
|
||||||
|
|||||||
Reference in New Issue
Block a user