Additional Product APIs for Focalboard multi-product architecture (#20527)

* bump focalboard version; add services to product API

* add API to fetch logger

* import boards in same fashion as enterprise
Этот коммит содержится в:
Doug Lauder
2022-06-23 07:55:50 -04:00
коммит произвёл GitHub
родитель 4b5d56a8c2
Коммит f4dcffd8d3
9 изменённых файлов: 99 добавлений и 50 удалений

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

@@ -10,6 +10,8 @@ import (
"sync"
"sync/atomic"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v6/app/imaging"
"github.com/mattermost/mattermost-server/v6/app/request"
"github.com/mattermost/mattermost-server/v6/config"
@@ -20,19 +22,8 @@ import (
"github.com/mattermost/mattermost-server/v6/services/imageproxy"
"github.com/mattermost/mattermost-server/v6/shared/filestore"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
"github.com/pkg/errors"
)
// configSvc is a consumer interface to work
// with any config related task with the server.
type configSvc interface {
Config() *model.Config
AddConfigListener(listener func(*model.Config, *model.Config)) string
RemoveConfigListener(id string)
UpdateConfig(f func(*model.Config))
SaveConfig(newCfg *model.Config, sendConfigChangeClusterMessage bool) (*model.Config, *model.Config, *model.AppError)
}
// licenseSvc is added to act as a starting point for future integrated products.
// It has the same signature and functionality with the license related APIs of the plugin-api.
type licenseSvc interface {
@@ -49,7 +40,7 @@ type namer interface {
// Channels contains all channels related state.
type Channels struct {
srv *Server
cfgSvc configSvc
cfgSvc product.ConfigService
filestore filestore.FileBackend
licenseSvc licenseSvc
routerSvc *routerService
@@ -135,7 +126,7 @@ func NewChannels(s *Server, services map[ServiceKey]interface{}) (*Channels, err
switch svcKey {
// Keep adding more services here
case ConfigKey:
cfgSvc, ok := svc.(configSvc)
cfgSvc, ok := svc.(product.ConfigService)
if !ok {
return nil, errors.New("Config service did not satisfy ConfigSvc interface")
}