mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-01 22:02:46 +00:00
Implement storage interfaces (#841)
* Implement interfaces for federationsender storage * Implement interfaces for mediaapi storage * Implement interfaces for publicroomsapi storage * Implement interfaces for roomserver storage * Implement interfaces for syncapi storage * Implement interfaces for keydb storage * common.PartitionStorer in publicroomsapi interface * Update copyright notices
This commit is contained in:
parent
6cab622468
commit
c28577ea25
60 changed files with 1594 additions and 1223 deletions
|
@ -53,7 +53,7 @@ type uploadResponse struct {
|
|||
// This implementation supports a configurable maximum file size limit in bytes. If a user tries to upload more than this, they will receive an error that their upload is too large.
|
||||
// Uploaded files are processed piece-wise to avoid DoS attacks which would starve the server of memory.
|
||||
// TODO: We should time out requests if they have not received any data within a configured timeout period.
|
||||
func Upload(req *http.Request, cfg *config.Dendrite, db *storage.Database, activeThumbnailGeneration *types.ActiveThumbnailGeneration) util.JSONResponse {
|
||||
func Upload(req *http.Request, cfg *config.Dendrite, db storage.Database, activeThumbnailGeneration *types.ActiveThumbnailGeneration) util.JSONResponse {
|
||||
r, resErr := parseAndValidateRequest(req, cfg)
|
||||
if resErr != nil {
|
||||
return *resErr
|
||||
|
@ -96,7 +96,7 @@ func (r *uploadRequest) doUpload(
|
|||
ctx context.Context,
|
||||
reqReader io.Reader,
|
||||
cfg *config.Dendrite,
|
||||
db *storage.Database,
|
||||
db storage.Database,
|
||||
activeThumbnailGeneration *types.ActiveThumbnailGeneration,
|
||||
) *util.JSONResponse {
|
||||
r.Logger.WithFields(log.Fields{
|
||||
|
@ -214,7 +214,7 @@ func (r *uploadRequest) storeFileAndMetadata(
|
|||
ctx context.Context,
|
||||
tmpDir types.Path,
|
||||
absBasePath config.Path,
|
||||
db *storage.Database,
|
||||
db storage.Database,
|
||||
thumbnailSizes []config.ThumbnailSize,
|
||||
activeThumbnailGeneration *types.ActiveThumbnailGeneration,
|
||||
maxThumbnailGenerators int,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue