move file backend to the platform service (#21365)

Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-10-21 12:24:36 +03:00
коммит произвёл GitHub
родитель b30e511ffe
Коммит 2ce3e81490
6 изменённых файлов: 58 добавлений и 38 удалений

Просмотреть файл

@@ -11,6 +11,7 @@ import (
"github.com/mattermost/mattermost-server/v6/config"
"github.com/mattermost/mattermost-server/v6/einterfaces"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/shared/filestore"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
"github.com/mattermost/mattermost-server/v6/store"
"github.com/mattermost/mattermost-server/v6/store/localcachelayer"
@@ -74,6 +75,13 @@ func Config(dsn string, readOnly bool, configDefaults *model.Config) Option {
}
}
func SetFileStore(filestore filestore.FileBackend) Option {
return func(ps *PlatformService) error {
ps.filestore = filestore
return nil
}
}
// ConfigStore applies the given config store, typically to replace the traditional sources with a memory store for testing.
func ConfigStore(configStore *config.Store) Option {
return func(ps *PlatformService) error {