memory

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL