focalboard/server/app/app.go

52 lines
1.4 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 21:11:21 +01:00
"github.com/mattermost/focalboard/server/auth"
"github.com/mattermost/focalboard/server/model"
2021-01-26 23:13:46 +01:00
"github.com/mattermost/focalboard/server/services/config"
"github.com/mattermost/focalboard/server/services/metrics"
"github.com/mattermost/focalboard/server/services/mlog"
2021-01-26 23:13:46 +01:00
"github.com/mattermost/focalboard/server/services/store"
"github.com/mattermost/focalboard/server/services/webhook"
"github.com/mattermost/mattermost-server/v6/shared/filestore"
2020-10-16 16:36:08 +02:00
)
type WebsocketServer interface {
BroadcastBlockChange(workspaceID string, block model.Block)
BroadcastBlockDelete(workspaceID, blockID, parentID string)
}
type Services struct {
Auth *auth.Auth
Store store.Store
FilesBackend filestore.FileBackend
Webhook *webhook.Client
Metrics *metrics.Metrics
Logger *mlog.Logger
}
2020-10-16 16:21:42 +02:00
type App struct {
config *config.Configuration
store store.Store
2021-02-02 21:11:21 +01:00
auth *auth.Auth
wsServer WebsocketServer
filesBackend filestore.FileBackend
2020-10-29 21:42:43 +01:00
webhook *webhook.Client
metrics *metrics.Metrics
logger *mlog.Logger
}
func New(config *config.Configuration, wsServer WebsocketServer, services Services) *App {
2021-02-02 21:11:21 +01:00
return &App{
config: config,
store: services.Store,
auth: services.Auth,
2021-02-02 21:11:21 +01:00
wsServer: wsServer,
filesBackend: services.FilesBackend,
webhook: services.Webhook,
metrics: services.Metrics,
logger: services.Logger,
2021-02-02 21:11:21 +01:00
}
2020-10-16 16:21:42 +02:00
}