Documentation
¶
Index ¶
- func DeleteLimiter(tag string)
- func Init()
- type Limiter
- func (l *Limiter) CheckLimit(taguuid string, ip string, isTcp bool, noSSUDP bool) (Bucket *ratelimit.Bucket, Reject bool)
- func (l *Limiter) GetOnlineDevice() (*[]panel.OnlineUser, error)
- func (l *Limiter) UpdateDynamicSpeedLimit(tag, uuid string, limit int, expire time.Time) error
- func (l *Limiter) UpdateUser(tag string, added []panel.UserInfo, deleted []panel.UserInfo)
- type UserIpList
- type UserLimitInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteLimiter ¶
func DeleteLimiter(tag string)
Types ¶
type Limiter ¶
type Limiter struct {
DomainRules []*regexp.Regexp
ProtocolRules []string
SpeedLimit int
UserOnlineIP *sync.Map // Key: TagUUID, value: {Key: Ip, value: Uid}
OldUserOnline *sync.Map // Key: Ip, value: Uid
UUIDtoUID map[string]int // Key: UUID, value: Uid
UserLimitInfo *sync.Map // Key: TagUUID value: UserLimitInfo
SpeedLimiter *sync.Map // key: TagUUID, value: *ratelimit.Bucket
AliveList map[int]int // Key: Uid, value: alive_ip
}
func AddLimiter ¶
func GetLimiter ¶
func (*Limiter) CheckLimit ¶
func (*Limiter) GetOnlineDevice ¶
func (l *Limiter) GetOnlineDevice() (*[]panel.OnlineUser, error)
func (*Limiter) UpdateDynamicSpeedLimit ¶
type UserIpList ¶
Click to show internal directories.
Click to hide internal directories.