2020-10-21 09:56:03 +02:00
|
|
|
//go:generate mockgen -destination=mockstore/mockstore.go -package mockstore . Store
|
2020-10-16 19:20:43 +02:00
|
|
|
package store
|
|
|
|
|
2021-01-27 00:13:46 +02:00
|
|
|
import "github.com/mattermost/focalboard/server/model"
|
2020-10-16 19:20:43 +02:00
|
|
|
|
2020-10-22 15:22:36 +02:00
|
|
|
// Store represents the abstraction of the data storage.
|
2020-10-16 19:20:43 +02:00
|
|
|
type Store interface {
|
|
|
|
GetBlocksWithParentAndType(parentID string, blockType string) ([]model.Block, error)
|
|
|
|
GetBlocksWithParent(parentID string) ([]model.Block, error)
|
|
|
|
GetBlocksWithType(blockType string) ([]model.Block, error)
|
2020-11-12 20:16:59 +02:00
|
|
|
GetSubTree2(blockID string) ([]model.Block, error)
|
|
|
|
GetSubTree3(blockID string) ([]model.Block, error)
|
2020-10-16 19:20:43 +02:00
|
|
|
GetAllBlocks() ([]model.Block, error)
|
2021-01-13 04:49:08 +02:00
|
|
|
GetRootID(blockID string) (string, error)
|
2020-10-16 19:20:43 +02:00
|
|
|
GetParentID(blockID string) (string, error)
|
|
|
|
InsertBlock(block model.Block) error
|
2021-01-12 21:16:25 +02:00
|
|
|
DeleteBlock(blockID string, modifiedBy string) error
|
2021-01-13 01:35:30 +02:00
|
|
|
|
2020-10-16 22:26:47 +02:00
|
|
|
Shutdown() error
|
2021-01-13 01:35:30 +02:00
|
|
|
|
2020-10-19 14:55:20 +02:00
|
|
|
GetSystemSettings() (map[string]string, error)
|
|
|
|
SetSystemSetting(key string, value string) error
|
2021-01-13 01:35:30 +02:00
|
|
|
|
2021-01-27 19:22:33 +02:00
|
|
|
GetRegisteredUserCount() (int, error)
|
2020-11-06 17:46:35 +02:00
|
|
|
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
|
2021-01-20 23:52:25 +02:00
|
|
|
UpdateUserPassword(username string, password string) error
|
2021-01-21 20:16:40 +02:00
|
|
|
UpdateUserPasswordByID(userID string, password string) error
|
2021-01-13 01:35:30 +02:00
|
|
|
|
2021-01-27 20:01:24 +02:00
|
|
|
GetActiveUserCount(updatedSecondsAgo int64) (int, error)
|
2020-12-07 18:04:35 +02:00
|
|
|
GetSession(token string, expireTime int64) (*model.Session, error)
|
2020-12-02 22:12:14 +02:00
|
|
|
CreateSession(session *model.Session) error
|
|
|
|
RefreshSession(session *model.Session) error
|
|
|
|
UpdateSession(session *model.Session) error
|
|
|
|
DeleteSession(sessionId string) error
|
2020-12-07 18:04:35 +02:00
|
|
|
CleanUpSessions(expireTime int64) error
|
2021-01-13 01:35:30 +02:00
|
|
|
|
|
|
|
UpsertSharing(sharing model.Sharing) error
|
|
|
|
GetSharing(rootID string) (*model.Sharing, error)
|
2021-01-14 02:56:01 +02:00
|
|
|
|
|
|
|
UpsertWorkspaceSignupToken(workspace model.Workspace) error
|
|
|
|
UpsertWorkspaceSettings(workspace model.Workspace) error
|
|
|
|
GetWorkspace(ID string) (*model.Workspace, error)
|
2020-10-16 19:20:43 +02:00
|
|
|
}
|