1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-27 08:31:20 +02:00
focalboard/server/ws/adapter.go
Jesús Espino bc37e97ae9
Applying migration changes (#2752)
* Applying migration changes

* Fixing linter erros

* Restoring userID

* Updated user id length

* Update server/app/category_boards.go

* Skiped creating categories for boards belonging to DMs

* Handled private group messages as well

* fix sql error for insert_at

* fix timestamp parsing

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Harshil Sharma <harshilsharma63@gmail.com>
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2022-04-13 16:10:53 -06:00

41 lines
1.7 KiB
Go

//go:generate mockgen --build_flags=--mod=mod -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"
)
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)
BroadcastSubscriptionChange(teamID string, subscription *model.Subscription)
}