feat(acl): connection level ip/geo blocking

- fixed access log logic
- implement acl at connection level
- acl logging
- ip/cidr blocking
- geoblocking with MaxMind database
This commit is contained in:
yusing
2025-04-25 10:47:52 +08:00
parent e513db62b0
commit b427ff1f88
32 changed files with 1359 additions and 193 deletions

View File

@@ -12,9 +12,7 @@ import (
)
type supportRotate interface {
io.Reader
io.Writer
io.Seeker
io.ReadSeeker
io.ReaderAt
io.WriterAt
Truncate(size int64) error
@@ -41,6 +39,14 @@ func (r *RotateResult) Print(logger *zerolog.Logger) {
Msg("log rotate result")
}
func (r *RotateResult) Add(other *RotateResult) {
r.NumBytesRead += other.NumBytesRead
r.NumBytesKeep += other.NumBytesKeep
r.NumLinesRead += other.NumLinesRead
r.NumLinesKeep += other.NumLinesKeep
r.NumLinesInvalid += other.NumLinesInvalid
}
type lineInfo struct {
Pos int64 // Position from the start of the file
Size int64 // Size of this line