mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-05 05:00:08 +00:00
update
refactor limiter fix getLink bug add connection limit move limit config to ControllerConfig del dynamic speed limit (next version will be re add) del online ip sync (next version will be re add)
This commit is contained in:
@@ -3,8 +3,6 @@ package core
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/Yuzuki616/V2bX/api/panel"
|
||||
"github.com/Yuzuki616/V2bX/core/app/dispatcher"
|
||||
"github.com/xtls/xray-core/core"
|
||||
"github.com/xtls/xray-core/features/inbound"
|
||||
)
|
||||
@@ -27,27 +25,3 @@ func (p *Core) AddInbound(config *core.InboundHandlerConfig) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *Core) AddInboundLimiter(tag string, nodeInfo *panel.NodeInfo, users []panel.UserInfo) error {
|
||||
return p.dispatcher.Limiter.AddInboundLimiter(tag, nodeInfo, users)
|
||||
}
|
||||
|
||||
func (p *Core) GetInboundLimiter(tag string) (*dispatcher.InboundInfo, error) {
|
||||
limit, ok := p.dispatcher.Limiter.InboundInfo.Load(tag)
|
||||
if ok {
|
||||
return limit.(*dispatcher.InboundInfo), nil
|
||||
}
|
||||
return nil, fmt.Errorf("not found limiter")
|
||||
}
|
||||
|
||||
func (p *Core) UpdateInboundLimiter(tag string, added []panel.UserInfo, deleted []panel.UserInfo) error {
|
||||
return p.dispatcher.Limiter.UpdateInboundLimiter(tag, added, deleted)
|
||||
}
|
||||
|
||||
func (p *Core) DeleteInboundLimiter(tag string) error {
|
||||
return p.dispatcher.Limiter.DeleteInboundLimiter(tag)
|
||||
}
|
||||
|
||||
func (p *Core) UpdateRule(tag string, newRuleList []panel.DestinationRule) error {
|
||||
return p.dispatcher.RuleManager.UpdateRule(tag, newRuleList)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user