iolimiter

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ILimiter

type ILimiter interface {
	CanWrite(userID uint64, chunkSize int) (bool, error)
	CanRead(userID uint64, chunkSize int) (bool, error)
}

type IOLimiter

type IOLimiter struct {
	UploadLimiter   *golimiter.Limiter
	DownloadLimiter *golimiter.Limiter
	// contains filtered or unexported fields
}

func NewIOLimiter

func NewIOLimiter(cap, cyc int, users userstore.IUserStore) *IOLimiter

func (*IOLimiter) CanRead

func (lm *IOLimiter) CanRead(id uint64, chunkSize int) (bool, error)

func (*IOLimiter) CanWrite

func (lm *IOLimiter) CanWrite(id uint64, chunkSize int) (bool, error)

Jump to

Keyboard shortcuts

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