Documentation ¶
Index ¶
- func NewMemoryAuth(ctx context.Context, config *conf.GlobalConfig) (stat.Authenticator, error)
- type MemoryAuthenticator
- type MemoryTrafficMeter
- func (m *MemoryTrafficMeter) Close() error
- func (m *MemoryTrafficMeter) Count(sent, recv int)
- func (m *MemoryTrafficMeter) Get() (uint64, uint64)
- func (m *MemoryTrafficMeter) GetAndReset() (uint64, uint64)
- func (m *MemoryTrafficMeter) GetSpeed() (uint64, uint64)
- func (m *MemoryTrafficMeter) GetSpeedLimit() (send, recv int)
- func (m *MemoryTrafficMeter) Hash() string
- func (m *MemoryTrafficMeter) LimitSpeed(send, recv int)
- func (m *MemoryTrafficMeter) Reset()
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.TrafficMeter)
func (*MemoryAuthenticator) DelUser ¶
func (a *MemoryAuthenticator) DelUser(hash string) error
func (*MemoryAuthenticator) ListUsers ¶
func (a *MemoryAuthenticator) ListUsers() []stat.TrafficMeter
type MemoryTrafficMeter ¶
type MemoryTrafficMeter struct { stat.TrafficMeter // contains filtered or unexported fields }
func (*MemoryTrafficMeter) Close ¶
func (m *MemoryTrafficMeter) Close() error
func (*MemoryTrafficMeter) Count ¶
func (m *MemoryTrafficMeter) Count(sent, recv int)
func (*MemoryTrafficMeter) Get ¶
func (m *MemoryTrafficMeter) Get() (uint64, uint64)
func (*MemoryTrafficMeter) GetAndReset ¶
func (m *MemoryTrafficMeter) GetAndReset() (uint64, uint64)
func (*MemoryTrafficMeter) GetSpeed ¶
func (m *MemoryTrafficMeter) GetSpeed() (uint64, uint64)
func (*MemoryTrafficMeter) GetSpeedLimit ¶
func (m *MemoryTrafficMeter) GetSpeedLimit() (send, recv int)
func (*MemoryTrafficMeter) Hash ¶
func (m *MemoryTrafficMeter) Hash() string
func (*MemoryTrafficMeter) LimitSpeed ¶
func (m *MemoryTrafficMeter) LimitSpeed(send, recv int)
func (*MemoryTrafficMeter) Reset ¶
func (m *MemoryTrafficMeter) Reset()
Click to show internal directories.
Click to hide internal directories.