1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-24 08:22:29 +02:00
focalboard/server/ws/adapter.go
Harshil Sharma eceb406535
Revert "Revert dnd (#4294)" (#4324)
This reverts commit 9fac8f476e.
2022-12-14 14:21:53 +05:30

47 lines
2.1 KiB
Go

//go:generate mockgen -destination=mocks/mockstore.go -package mocks . Store
package ws
import (
"github.com/mattermost/focalboard/server/model"
)
const (
websocketActionAuth = "AUTH"
websocketActionSubscribeTeam = "SUBSCRIBE_TEAM"
websocketActionUnsubscribeTeam = "UNSUBSCRIBE_TEAM"
websocketActionSubscribeBlocks = "SUBSCRIBE_BLOCKS"
websocketActionUnsubscribeBlocks = "UNSUBSCRIBE_BLOCKS"
websocketActionUpdateBoard = "UPDATE_BOARD"
websocketActionUpdateMember = "UPDATE_MEMBER"
websocketActionDeleteMember = "DELETE_MEMBER"
websocketActionUpdateBlock = "UPDATE_BLOCK"
websocketActionUpdateConfig = "UPDATE_CLIENT_CONFIG"
websocketActionUpdateCategory = "UPDATE_CATEGORY"
websocketActionUpdateCategoryBoard = "UPDATE_BOARD_CATEGORY"
websocketActionUpdateSubscription = "UPDATE_SUBSCRIPTION"
websocketActionUpdateCardLimitTimestamp = "UPDATE_CARD_LIMIT_TIMESTAMP"
websocketActionReorderCategories = "REORDER_CATEGORIES"
websocketActionReorderCategoryBoards = "REORDER_CATEGORY_BOARDS"
)
type Store interface {
GetBlock(blockID string) (*model.Block, error)
GetMembersForBoard(boardID string) ([]*model.BoardMember, error)
}
type Adapter interface {
BroadcastBlockChange(teamID string, block *model.Block)
BroadcastBlockDelete(teamID, blockID, boardID string)
BroadcastBoardChange(teamID string, board *model.Board)
BroadcastBoardDelete(teamID, boardID string)
BroadcastMemberChange(teamID, boardID string, member *model.BoardMember)
BroadcastMemberDelete(teamID, boardID, userID string)
BroadcastConfigChange(clientConfig model.ClientConfig)
BroadcastCategoryChange(category model.Category)
BroadcastCategoryBoardChange(teamID, userID string, blockCategory []*model.BoardCategoryWebsocketData)
BroadcastCardLimitTimestampChange(cardLimitTimestamp int64)
BroadcastSubscriptionChange(teamID string, subscription *model.Subscription)
BroadcastCategoryReorder(teamID, userID string, categoryOrder []string)
BroadcastCategoryBoardsReorder(teamID, userID, categoryID string, boardsOrder []string)
}