manager

package
Version: v0.0.0-...-caf6f44 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthManager

type AuthManager interface {
	Login(email, password string) (*models.Session, *fcerror.Error)
	Logout(token models.Token) *fcerror.Error
	VerifyToken(token models.Token) (*models.User, *fcerror.Error)
	CreateNewSession(userID models.UserID) (*models.Session, *fcerror.Error)
	Close()
}

AuthManager contains all use cases related to authentication and user management

func NewAuthManager

func NewAuthManager(cfg config.Config, authPersistence persistence.AuthPersistenceController, managers *Managers) AuthManager

type Managers

type Managers struct {
	Auth  AuthManager
	User  UserManager
	Node  NodeManager
	Share ShareManager
}

type NodeManager

type NodeManager interface {
	CreateUserRootFolder(authCtx *authorization.Context, userID models.UserID) *fcerror.Error
	GetNodeByPath(authCtx *authorization.Context, path string) (*models.Node, *fcerror.Error)
	GetNodeByID(authCtx *authorization.Context, nodeID models.NodeID) (*models.Node, *fcerror.Error)
	ListByID(authCtx *authorization.Context, nodeID models.NodeID) ([]*models.Node, *fcerror.Error)
	CreateNode(authCtx *authorization.Context, node *models.Node) (bool, *fcerror.Error)
	UploadFileByID(authCtx *authorization.Context, nodeID models.NodeID, uploadFilePath string) *fcerror.Error
	DownloadFile(authCtx *authorization.Context, nodeID models.NodeID) (*models.Node, io.ReadCloser, int64, *fcerror.Error)
	Close()
}

func NewNodeManager

func NewNodeManager(cfg config.Config, nodePersistence persistence.NodePersistenceController, fileStorage storage.FileStorageController, managers *Managers) NodeManager

type ShareManager

type ShareManager interface {
	CreateShare(authCtx *authorization.Context, share *models.Share) (bool, *fcerror.Error)
	Close()
}

func NewShareManager

func NewShareManager(
	cfg config.Config,
	sharePersistence persistence.SharePersistenceController,
	nodePersistence persistence.NodePersistenceController,
	managers *Managers,
) ShareManager

type UserManager

type UserManager interface {
	CreateUser(user *models.User) (*models.Session, *fcerror.Error)
	GetUserByID(authCtx *authorization.Context, userID models.UserID) (*models.User, *fcerror.Error)
	GetUserByEmail(authCtx *authorization.Context, email string) (*models.User, *fcerror.Error)
	UpdateUser(authCtx *authorization.Context, userID models.UserID, updateUser *models.UserUpdate) (*models.User, *fcerror.Error)
	CountUsers(authCtx *authorization.Context) (int64, *fcerror.Error)
	Close()
}

func NewUserManager

func NewUserManager(cfg config.Config, userPersistence persistence.UserPersistenceController, managers *Managers) UserManager

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL