Documentation
¶
Index ¶
- Constants
- func AddUser(name string, user *User) (string, error)
- func DeInit()
- func DelUser(name string) (bool, error)
- func GenUserKey(name string) string
- func GetUserNameList(limita, limitb string) []string
- func Init(user, passwd, host string) error
- func UpdateUser(name string, user *User) error
- func UpdateUserKey(name, key string) error
- type User
- func (u *User) CheckIpLimit(ip string) bool
- func (u *User) CheckOnlineServiceNum() bool
- func (u *User) CheckPipeNum(n int) bool
- func (u *User) CheckSessionNum(n int) bool
- func (u *User) CheckType() bool
- func (u *User) DeInit()
- func (u *User) IsAlive() bool
- func (u *User) OnLogin()
- func (u *User) OnLogout()
- func (u *User) SetCacheTime(t int64)
- func (u *User) UpdateCSMode(size int) bool
Constants ¶
View Source
const ( UserType_Normal = iota UserType_BlackList UserType_Super UserType_Admin CacheTime = 30 DefaultMaxOnlineServerNum = 2 DefaultMaxSessionNum = 2 DefaultMaxPipeNum = 2 DefaultMaxSameIPServers = 2 DefaultMaxCSModeData = 10000000 //bytes )
Variables ¶
This section is empty.
Functions ¶
func GenUserKey ¶
func GetUserNameList ¶
func UpdateUser ¶
func UpdateUserKey ¶
Types ¶
type User ¶
type User struct { //save to database UserName string Passwd string UserType int AuthKey string LastLoginTime int64 LastLogoutTime int64 MaxOnlineServerNum int MaxSessionNum int MaxPipeNum int MaxSameIPServers int TodayCSModeData int LimitDataSize int `stop:"true"` // contains filtered or unexported fields }
func GetUserByKey ¶
func (*User) CheckIpLimit ¶
func (*User) CheckOnlineServiceNum ¶
func (*User) CheckPipeNum ¶
func (*User) CheckSessionNum ¶
func (*User) SetCacheTime ¶
func (*User) UpdateCSMode ¶
Click to show internal directories.
Click to hide internal directories.