f1b8d88d6b
* Improving mattermost auth implementation * Making mattermost-auth based on shared database access * Reverting unneeded changes in the config.json file * Fixing tiny problems * Removing the need of using the mattermost session token * Fixing some bugs and allowing to not-bind the server to any port * Small fix to correctly get the templates * Adding the mattermost-plugin code inside focalboard repo * Adding a not working code part of the cluster websocket communication * Updating the mattermost version * Adding the cluster messages for the websockets * Updating to the new node version * Making it compatible with S3 * Addressing some tiny problems * Fixing server tests * Adds support for MySQL migrations and initialization Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
55 lines
2.3 KiB
Go
55 lines
2.3 KiB
Go
//go:generate mockgen -destination=mockstore/mockstore.go -package mockstore . Store
|
|
package store
|
|
|
|
import "github.com/mattermost/focalboard/server/model"
|
|
|
|
// Conainer represents a container in a store
|
|
// Using a struct to make extending this easier in the future
|
|
type Container struct {
|
|
WorkspaceID string
|
|
}
|
|
|
|
// Store represents the abstraction of the data storage.
|
|
type Store interface {
|
|
GetBlocksWithParentAndType(c Container, parentID string, blockType string) ([]model.Block, error)
|
|
GetBlocksWithParent(c Container, parentID string) ([]model.Block, error)
|
|
GetBlocksWithRootID(c Container, rootID string) ([]model.Block, error)
|
|
GetBlocksWithType(c Container, blockType string) ([]model.Block, error)
|
|
GetSubTree2(c Container, blockID string) ([]model.Block, error)
|
|
GetSubTree3(c Container, blockID string) ([]model.Block, error)
|
|
GetAllBlocks(c Container) ([]model.Block, error)
|
|
GetRootID(c Container, blockID string) (string, error)
|
|
GetParentID(c Container, blockID string) (string, error)
|
|
InsertBlock(c Container, block model.Block) error
|
|
DeleteBlock(c Container, blockID string, modifiedBy string) error
|
|
|
|
Shutdown() error
|
|
|
|
GetSystemSettings() (map[string]string, error)
|
|
SetSystemSetting(key, value string) error
|
|
|
|
GetRegisteredUserCount() (int, error)
|
|
GetUserById(userID string) (*model.User, error)
|
|
GetUserByEmail(email string) (*model.User, error)
|
|
GetUserByUsername(username string) (*model.User, error)
|
|
CreateUser(user *model.User) error
|
|
UpdateUser(user *model.User) error
|
|
UpdateUserPassword(username, password string) error
|
|
UpdateUserPasswordByID(userID, password string) error
|
|
|
|
GetActiveUserCount(updatedSecondsAgo int64) (int, error)
|
|
GetSession(token string, expireTime int64) (*model.Session, error)
|
|
CreateSession(session *model.Session) error
|
|
RefreshSession(session *model.Session) error
|
|
UpdateSession(session *model.Session) error
|
|
DeleteSession(sessionId string) error
|
|
CleanUpSessions(expireTime int64) error
|
|
|
|
UpsertSharing(c Container, sharing model.Sharing) error
|
|
GetSharing(c Container, rootID string) (*model.Sharing, error)
|
|
|
|
UpsertWorkspaceSignupToken(workspace model.Workspace) error
|
|
UpsertWorkspaceSettings(workspace model.Workspace) error
|
|
GetWorkspace(ID string) (*model.Workspace, error)
|
|
HasWorkspaceAccess(userID string, workspaceID string) (bool, error)
|
|
}
|