Documentation ¶
Index ¶
- Constants
- func NewAuthenticator(ctx context.Context) (statistic.Authenticator, error)
- type Authenticator
- type Config
- type User
- func (u *User) AddIP(ip string) bool
- func (u *User) AddTraffic(sent, recv int)
- func (u *User) Close() error
- func (u *User) DelIP(ip string) bool
- func (u *User) GetIP() int
- func (u *User) GetIPLimit() int
- func (u *User) GetSpeed() (uint64, uint64)
- func (u *User) GetSpeedLimit() (send, recv int)
- func (u *User) GetTraffic() (uint64, uint64)
- func (u *User) Hash() string
- func (u *User) ResetTraffic() (uint64, uint64)
- func (u *User) SetIPLimit(n int)
- func (u *User) SetSpeedLimit(send, recv int)
- func (u *User) SetTraffic(send, recv uint64)
Constants ¶
View Source
const Name = "MEMORY"
Variables ¶
This section is empty.
Functions ¶
func NewAuthenticator ¶
func NewAuthenticator(ctx context.Context) (statistic.Authenticator, error)
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func (*Authenticator) AddUser ¶
func (a *Authenticator) AddUser(hash string) error
func (*Authenticator) AuthUser ¶
func (a *Authenticator) AuthUser(hash string) (bool, statistic.User)
func (*Authenticator) Close ¶
func (a *Authenticator) Close() error
func (*Authenticator) DelUser ¶
func (a *Authenticator) DelUser(hash string) error
func (*Authenticator) ListUsers ¶
func (a *Authenticator) ListUsers() []statistic.User
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) AddTraffic ¶
func (*User) GetIPLimit ¶
func (*User) GetSpeedLimit ¶
func (*User) GetTraffic ¶
func (*User) ResetTraffic ¶
func (*User) SetIPLimit ¶
func (*User) SetSpeedLimit ¶
func (*User) SetTraffic ¶ added in v0.7.5
Click to show internal directories.
Click to hide internal directories.