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) Password() string
- func (u *User) ResetTraffic() (uint64, uint64)
- func (u *User) RouterName() string
- 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 ¶
func (*Authenticator) AddUser ¶
func (a *Authenticator) AddUser(password, 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) RouterName ¶
func (*User) SetIPLimit ¶
func (*User) SetSpeedLimit ¶
func (*User) SetTraffic ¶
Click to show internal directories.
Click to hide internal directories.