feat: add tus getter

This commit is contained in:
Derrick Hammer 2024-01-19 16:51:41 -05:00
parent 2c30477465
commit 4c92750dd0
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 7 additions and 2 deletions

View File

@ -23,5 +23,6 @@ type StorageService interface {
TusUploadProgress(uploadID string) error
DeleteTusUpload(uploadID string) error
ScheduleTusUpload(uploadID string, attempt int) error
Tus() *tusd.Handler
Service
}

View File

@ -7,7 +7,7 @@ import (
"errors"
"git.lumeweb.com/LumeWeb/libs5-go/encoding"
"git.lumeweb.com/LumeWeb/libs5-go/types"
"git.lumeweb.com/LumeWeb/portal/api/s5"
"git.lumeweb.com/LumeWeb/portal/api/middleware"
"git.lumeweb.com/LumeWeb/portal/db/models"
"git.lumeweb.com/LumeWeb/portal/interfaces"
"github.com/aws/aws-sdk-go-v2/aws"
@ -36,6 +36,10 @@ type StorageServiceImpl struct {
tusStore tusd.DataStore
}
func (s *StorageServiceImpl) Tus() *tusd.Handler {
return s.tus
}
func (s *StorageServiceImpl) Start() error {
return nil
}
@ -312,7 +316,7 @@ func (s *StorageServiceImpl) tusWorker() {
continue
}
uploaderID, ok := info.Context.Value(s5.AuthUserIDKey).(uint)
uploaderID, ok := info.Context.Value(middleware.S5AuthUserIDKey).(uint)
if !ok {
s.portal.Logger().Error("Missing user id in context")
continue