feat(files): enable upload limiter

This commit is contained in:
hexxa 2021-08-07 21:06:43 +08:00 committed by Hexxa
parent e01f5f8351
commit fd5da3db37
5 changed files with 118 additions and 0 deletions

View file

@ -7,6 +7,7 @@ import (
"github.com/ihexxa/quickshare/src/cryptoutil"
"github.com/ihexxa/quickshare/src/fs"
"github.com/ihexxa/quickshare/src/idgen"
"github.com/ihexxa/quickshare/src/iolimiter"
"github.com/ihexxa/quickshare/src/kvstore"
"github.com/ihexxa/quickshare/src/userstore"
)
@ -27,6 +28,7 @@ type Deps struct {
uploader IUploader
id idgen.IIDGen
logger *zap.SugaredLogger
limiter iolimiter.ILimiter
}
func NewDeps(cfg gocfg.ICfg) *Deps {
@ -80,3 +82,11 @@ func (deps *Deps) Users() userstore.IUserStore {
func (deps *Deps) SetUsers(users userstore.IUserStore) {
deps.users = users
}
func (deps *Deps) Limiter() iolimiter.ILimiter {
return deps.limiter
}
func (deps *Deps) SetLimiter(limiter iolimiter.ILimiter) {
deps.limiter = limiter
}