memory

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: May 15, 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.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()

Jump to

Keyboard shortcuts

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