1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-24 13:43:12 +02:00
focalboard/server/app/app.go

56 lines
1.5 KiB
Go
Raw Normal View History

package app
2020-10-16 16:21:42 +02:00
2020-10-16 16:36:08 +02:00
import (
2021-02-02 22:11:21 +02:00
"github.com/mattermost/focalboard/server/auth"
2021-01-27 00:13:46 +02:00
"github.com/mattermost/focalboard/server/services/config"
"github.com/mattermost/focalboard/server/services/metrics"
2021-09-13 21:36:36 +02:00
"github.com/mattermost/focalboard/server/services/notify"
2021-01-27 00:13:46 +02:00
"github.com/mattermost/focalboard/server/services/store"
"github.com/mattermost/focalboard/server/services/webhook"
"github.com/mattermost/focalboard/server/ws"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
"github.com/mattermost/mattermost-server/v6/shared/filestore"
2020-10-16 16:36:08 +02:00
)
type Services struct {
2021-09-13 21:36:36 +02:00
Auth *auth.Auth
Store store.Store
FilesBackend filestore.FileBackend
Webhook *webhook.Client
Metrics *metrics.Metrics
Notifications *notify.Service
Logger *mlog.Logger
}
2020-10-16 16:21:42 +02:00
type App struct {
2021-09-13 21:36:36 +02:00
config *config.Configuration
store store.Store
auth *auth.Auth
wsAdapter ws.Adapter
filesBackend filestore.FileBackend
webhook *webhook.Client
metrics *metrics.Metrics
notifications *notify.Service
logger *mlog.Logger
}
func (a *App) SetConfig(config *config.Configuration) {
a.config = config
}
func New(config *config.Configuration, wsAdapter ws.Adapter, services Services) *App {
2021-02-02 22:11:21 +02:00
return &App{
2021-09-13 21:36:36 +02:00
config: config,
store: services.Store,
auth: services.Auth,
wsAdapter: wsAdapter,
filesBackend: services.FilesBackend,
webhook: services.Webhook,
metrics: services.Metrics,
notifications: services.Notifications,
logger: services.Logger,
2021-02-02 22:11:21 +02:00
}
2020-10-16 16:21:42 +02:00
}