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