Documentation ¶
Index ¶
- Constants
- func AddInboundUser(ctx context.Context, c proxy.HandlerServiceClient, tag string, user *User) error
- func InProxyTags(tag string) bool
- func NewBandwidthRecorder(metricsURL string) *bandwidthRecorder
- func RemoveInboundUser(ctx context.Context, c proxy.HandlerServiceClient, tag string, user *User) error
- type SyncTrafficReq
- type SyncUserConfigsResp
- type User
- type UserPool
- func (up *UserPool) CreateUser(userId, level int, password, method, protocol string, enable bool) *User
- func (up *UserPool) GetAllUsers() []*User
- func (up *UserPool) GetUser(id int) (*User, bool)
- func (up *UserPool) RemoveUser(id int)
- func (up *UserPool) Start(ctx context.Context) error
- func (up *UserPool) Stop()
- type UserTraffic
- type XrayServer
Constants ¶
View Source
const ( XrayAPITag = "api" XraySSProxyTag = "ss_proxy" XrayTrojanProxyTag = "trojan_proxy" XrayVmessProxyTag = "vmess_proxy" XrayVlessProxyTag = "vless_proxy" XraySSRProxyTag = "ssr_proxy" SyncTime = 60 ProtocolSS = "ss" ProtocolTrojan = "trojan" )
Variables ¶
This section is empty.
Functions ¶
func AddInboundUser ¶
func AddInboundUser(ctx context.Context, c proxy.HandlerServiceClient, tag string, user *User) error
AddInboundUser add user to inbound by tag
func InProxyTags ¶ added in v1.1.3
func NewBandwidthRecorder ¶ added in v1.1.3
func NewBandwidthRecorder(metricsURL string) *bandwidthRecorder
func RemoveInboundUser ¶
func RemoveInboundUser(ctx context.Context, c proxy.HandlerServiceClient, tag string, user *User) error
RemoveInboundUser remove user from inbound by tag
Types ¶
type SyncTrafficReq ¶
type SyncTrafficReq struct { Data []*UserTraffic `json:"data"` UploadBandwidth int64 `json:"upload_bandwidth"` DownloadBandwidth int64 `json:"download_bandwidth"` }
func (*SyncTrafficReq) GetTotalTraffic ¶ added in v1.1.3
func (s *SyncTrafficReq) GetTotalTraffic() int64
type SyncUserConfigsResp ¶
type SyncUserConfigsResp struct {
Users []*User `json:"users"`
}
type User ¶
type User struct { ID int `json:"user_id"` Method string `json:"method"` Password string `json:"password"` Level int `json:"level"` Enable bool `json:"enable"` UploadTraffic int64 `json:"upload_traffic"` DownloadTraffic int64 `json:"download_traffic"` Protocol string `json:"protocol"` // contains filtered or unexported fields }
func (*User) GenTraffic ¶
func (u *User) GenTraffic() *UserTraffic
func (*User) ResetTraffic ¶
func (u *User) ResetTraffic()
func (*User) ToXrayUser ¶
func (*User) UpdateFromServer ¶
type UserPool ¶
func NewUserPool ¶
func (*UserPool) CreateUser ¶
func (*UserPool) GetAllUsers ¶
func (*UserPool) RemoveUser ¶
type UserTraffic ¶
type XrayServer ¶ added in v1.1.3
type XrayServer struct {
// contains filtered or unexported fields
}
func NewXrayServer ¶ added in v1.1.3
func NewXrayServer(cfg *config.Config) *XrayServer
func (*XrayServer) Reload ¶ added in v1.1.3
func (xs *XrayServer) Reload() error
func (*XrayServer) Setup ¶ added in v1.1.3
func (xs *XrayServer) Setup() error
func (*XrayServer) Stop ¶ added in v1.1.3
func (xs *XrayServer) Stop()
Click to show internal directories.
Click to hide internal directories.