implemented mongo gridFS for file upload
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"time"
|
||||
"tm/pkg/authorization"
|
||||
"tm/pkg/config"
|
||||
"tm/pkg/filestore"
|
||||
"tm/pkg/glm"
|
||||
"tm/pkg/hcaptcha"
|
||||
"tm/pkg/logger"
|
||||
@@ -315,3 +316,20 @@ func InitGLMService(conf GLMConfig, log logger.Logger) *glm.SDK {
|
||||
|
||||
return glmSDK
|
||||
}
|
||||
|
||||
// InitFileStore initializes the GridFS file store service
|
||||
func InitFileStore(mongoManager *mongo.ConnectionManager, log logger.Logger) (*filestore.GridFSService, error) {
|
||||
fileStoreService, err := filestore.NewGridFSService(mongoManager, log)
|
||||
if err != nil {
|
||||
log.Error("Failed to initialize file store service", map[string]interface{}{
|
||||
"error": err.Error(),
|
||||
})
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.Info("File store service initialized successfully", map[string]interface{}{
|
||||
"storage_type": "MongoDB GridFS",
|
||||
})
|
||||
|
||||
return fileStoreService, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user