Documentation ¶
Index ¶
- Variables
- func AddInboundUser(c v2proxyman.HandlerServiceClient, tag string, user *User)
- func GetAndResetUserTraffic(c v2stats.StatsServiceClient, up *UserPool)
- func RemoveInboundUser(c v2proxyman.HandlerServiceClient, tag string, user *User)
- func SyncTask(up *UserPool)
- type User
- type UserConfig
- type UserPool
- func (up *UserPool) CreateUser(userId int, email, uuid string, level, alterId uint32, enable bool) (*User, error)
- func (up *UserPool) GetAllUsers() []*User
- func (up *UserPool) GetUserByEmail(email string) (*User, error)
- func (up *UserPool) GetUsersNum() int
- func (up *UserPool) RemoveUserByEmail(email string)
- type UserTraffic
Constants ¶
This section is empty.
Variables ¶
View Source
var API_ENDPOINT string
View Source
var GRPC_ENDPOINT string
Functions ¶
func AddInboundUser ¶
func AddInboundUser(c v2proxyman.HandlerServiceClient, tag string, user *User)
AddInboundUser add user to inbound by tag
func GetAndResetUserTraffic ¶
func GetAndResetUserTraffic(c v2stats.StatsServiceClient, up *UserPool)
GetAndResetUserTraffic 统计所有user的上行下行流量 V2ray的stats的统计模块设计的非常奇怪,具体规则如下 上传流量:"user>>>" + user.Email + ">>>traffic>>>uplink" 下载流量:"user>>>" + user.Email + ">>>traffic>>>downlink"
func RemoveInboundUser ¶
func RemoveInboundUser(c v2proxyman.HandlerServiceClient, tag string, user *User)
RemoveInboundUser remove user from inbound by tag
Types ¶
type User ¶
type User struct { UserId int `json:"user_id"` Email string `json:"email"` UUID string `json:"uuid"` AlterId uint32 `json:"alter_id"` Level uint32 `json:"level"` Enable bool `json:"enable"` UploadTraffic int64 `json:"upload_traffic"` DownloadTraffic int64 `json:"download_traffic"` // contains filtered or unexported fields }
User V2ray User
type UserConfig ¶
type UserPool ¶
type UserPool struct {
// contains filtered or unexported fields
}
UserPool user pool
func (*UserPool) CreateUser ¶
func (up *UserPool) CreateUser(userId int, email, uuid string, level, alterId uint32, enable bool) (*User, error)
CreateUser get create user
func (*UserPool) GetUserByEmail ¶
GetUserByEmail get user by email
func (*UserPool) RemoveUserByEmail ¶
RemoveUserByEmail get user by email
type UserTraffic ¶
Click to show internal directories.
Click to hide internal directories.