Documentation ¶
Index ¶
- func NewRedisAuth(ctx context.Context, config *conf.GlobalConfig) (stat.Authenticator, error)
- type RedisAuthenticator
- type RedisUser
- func (m *RedisUser) AddIP(string) bool
- func (m *RedisUser) AddTraffic(sent, recv int)
- func (m *RedisUser) Close() error
- func (m *RedisUser) DelIP(string) bool
- func (m *RedisUser) GetAndResetTraffic() (uint64, uint64)
- func (u *RedisUser) GetIP() int
- func (m *RedisUser) GetIPLimit() int
- func (m *RedisUser) GetSpeed() (uint64, uint64)
- func (m *RedisUser) GetSpeedLimit() (send, recv int)
- func (m *RedisUser) GetTraffic() (uint64, uint64)
- func (m *RedisUser) Hash() string
- func (m *RedisUser) ResetTraffic()
- func (m *RedisUser) SetIPLimit(int)
- func (m *RedisUser) SetSpeedLimit(send, recv int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedisAuth ¶ added in v0.4.5
func NewRedisAuth(ctx context.Context, config *conf.GlobalConfig) (stat.Authenticator, error)
Types ¶
type RedisAuthenticator ¶ added in v0.4.5
type RedisAuthenticator struct { stat.Authenticator // contains filtered or unexported fields }
func (*RedisAuthenticator) AddUser ¶ added in v0.4.5
func (a *RedisAuthenticator) AddUser(hash string) error
func (*RedisAuthenticator) AuthUser ¶ added in v0.4.5
func (a *RedisAuthenticator) AuthUser(hash string) (bool, stat.User)
func (*RedisAuthenticator) DelUser ¶ added in v0.4.5
func (a *RedisAuthenticator) DelUser(hash string) error
func (*RedisAuthenticator) ListUsers ¶ added in v0.4.5
func (a *RedisAuthenticator) ListUsers() []stat.User
type RedisUser ¶ added in v0.4.12
type RedisUser struct {
// contains filtered or unexported fields
}
func (*RedisUser) AddTraffic ¶ added in v0.4.12
func (*RedisUser) GetAndResetTraffic ¶ added in v0.4.12
func (*RedisUser) GetIPLimit ¶ added in v0.4.12
func (*RedisUser) GetSpeedLimit ¶ added in v0.4.12
func (*RedisUser) GetTraffic ¶ added in v0.4.12
func (*RedisUser) ResetTraffic ¶ added in v0.4.12
func (m *RedisUser) ResetTraffic()
func (*RedisUser) SetIPLimit ¶ added in v0.4.12
func (*RedisUser) SetSpeedLimit ¶ added in v0.4.12
Click to show internal directories.
Click to hide internal directories.