mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-12 22:42:18 +00:00
Introduce user level
This commit is contained in:
1 parent
d585ec0593
commit
b44098d752
6 files changed
+58
-20
No files matched your search
@@ -1,5 +1,27 @@
|
||||
package config
|
||||
|
||||
type UserLevel int
|
||||
|
||||
const (
|
||||
UserLevelAdmin = UserLevel(999)
|
||||
UserLevelUntrusted = UserLevel(0)
|
||||
)
|
||||
|
||||
type User interface {
|
||||
ID() *ID
|
||||
Level() UserLevel
|
||||
}
|
||||
|
||||
type UserSettings struct {
|
||||
PayloadReadTimeout int
|
||||
}
|
||||
|
||||
func GetUserSettings(level UserLevel) UserSettings {
|
||||
settings := UserSettings {
|
||||
PayloadReadTimeout: 120,
|
||||
}
|
||||
if level > 0 {
|
||||
settings.PayloadReadTimeout = 0
|
||||
}
|
||||
return settings
|
||||
}
|
||||
Reference in new issue
Block a user