mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-11 19:56:37 +08:00
feat: implement user and forward max connection limit (#461)
* docs: add implementation plan for max conn limit * feat: add CLimiters support for websocket reporter * feat: add max_conn field to user and forward models * feat: implement max conn limiter dispatching * feat: add maxConn to user and forward CRUD API * feat: add max conn UI to user management and forward rules * fix: load MaxConn in get forward record and add e2e contract test for max conn limit
This commit is contained in:
@@ -23,6 +23,7 @@ type User struct {
|
||||
CreatedTime int64 `gorm:"column:created_time;not null"`
|
||||
UpdatedTime sql.NullInt64 `gorm:"column:updated_time"`
|
||||
Status int `gorm:"not null"`
|
||||
MaxConn int `gorm:"column:max_conn;not null;default:0"`
|
||||
}
|
||||
|
||||
func (User) TableName() string { return "user" }
|
||||
@@ -43,6 +44,7 @@ type Forward struct {
|
||||
Status int `gorm:"not null"`
|
||||
Inx int `gorm:"not null;default:0"`
|
||||
SpeedID sql.NullInt64 `gorm:"column:speed_id"`
|
||||
MaxConn int `gorm:"column:max_conn;not null;default:0"`
|
||||
}
|
||||
|
||||
func (Forward) TableName() string { return "forward" }
|
||||
@@ -537,6 +539,7 @@ type ForwardRecord struct {
|
||||
Strategy string
|
||||
Status int
|
||||
SpeedID sql.NullInt64
|
||||
MaxConn int
|
||||
}
|
||||
|
||||
// TunnelRecord is a minimal tunnel view used by control plane.
|
||||
|
||||
Reference in New Issue
Block a user