stat

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAuthCreator added in v0.4.3

func RegisterAuthCreator(name string, creator AuthCreator)

Types

type AuthCreator added in v0.4.3

type AuthCreator func(ctx context.Context, config *conf.GlobalConfig) (Authenticator, error)

type Authenticator

type Authenticator interface {
	io.Closer
	AuthUser(hash string) (valid bool, user User)
	AddUser(hash string) error
	DelUser(hash string) error
	ListUsers() []User
}

func NewAuth added in v0.4.3

func NewAuth(ctx context.Context, name string, config *conf.GlobalConfig) (Authenticator, error)

type IPRecorder added in v0.4.12

type IPRecorder interface {
	AddIP(string) bool
	DelIP(string) bool
	GetIP() int
	SetIPLimit(int)
	GetIPLimit() int
}

type TrafficMeter

type TrafficMeter interface {
	io.Closer
	Hash() string
	AddTraffic(sent, recv int)
	GetTraffic() (sent, recv uint64)
	ResetTraffic()
	GetAndResetTraffic() (sent, recv uint64)
	GetSpeed() (sent, recv uint64)
	SetSpeedLimit(send, recv int)
	GetSpeedLimit() (send, recv int)
}

type User added in v0.4.12

type User interface {
	TrafficMeter
	IPRecorder
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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