1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-12 09:04:14 +02:00
focalboard/server/ws/adapter.go
Doug Lauder 75bd409ba0
Notifications phase 1 (#1851)
Backend support for subscribing/unsubscribing to blocks, typically cards and boards. Notifies subscribers when changes are made to cards they are subscribed to.
2021-12-10 10:46:37 -05:00

24 lines
837 B
Go

package ws
import (
"github.com/mattermost/focalboard/server/model"
)
const (
websocketActionAuth = "AUTH"
websocketActionSubscribeWorkspace = "SUBSCRIBE_WORKSPACE"
websocketActionUnsubscribeWorkspace = "UNSUBSCRIBE_WORKSPACE"
websocketActionSubscribeBlocks = "SUBSCRIBE_BLOCKS"
websocketActionUnsubscribeBlocks = "UNSUBSCRIBE_BLOCKS"
websocketActionUpdateBlock = "UPDATE_BLOCK"
websocketActionUpdateConfig = "UPDATE_CLIENT_CONFIG"
websocketActionUpdateSubscription = "UPDATE_SUBSCRIPTION"
)
type Adapter interface {
BroadcastBlockChange(workspaceID string, block model.Block)
BroadcastBlockDelete(workspaceID, blockID, parentID string)
BroadcastConfigChange(clientConfig model.ClientConfig)
BroadcastSubscriptionChange(workspaceID string, subscription *model.Subscription)
}