service

package
v0.0.0-...-3afac47 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(ctx context.Context, fromId, toId int64, fileIds []int64) (totalSize uint64, err error)

func CopyFolder

func CopyFolder(ctx context.Context, to *model.Folder, foders []*model.Folder) (totalSize uint64, err error)

func CreateFolder

func CreateFolder(ctx context.Context, folder *model.Folder) (err error)

func DeleteFile

func DeleteFile(ctx context.Context, ids []int64, folderId int64) (allowDelFileHashList []string, err error)

func DeleteFolder

func DeleteFolder(ctx context.Context, ids []int64, userId int64) (allowDelFileHashList []string, err error)

func ExistFile

func ExistFile(ctx context.Context, filename string, folderId, userId int64) (isExist bool, err error)

func ExistFolder

func ExistFolder(ctx context.Context, userId, parentId int64, folderName string) (isExist bool)

func GroupCreate

func GroupCreate(ctx context.Context, group *model.Group) (err error)

func GroupDelete

func GroupDelete(ctx context.Context, id int64) (err error)

func GroupExist

func GroupExist(ctx context.Context, name string) (isExist bool, err error)

func GroupList

func GroupList(ctx context.Context, offset, limit int64) (groups []*model.WrapGroupList, count int64, err error)

func GroupUpdate

func GroupUpdate(ctx context.Context, id int64, data map[string]interface{}) (err error)

func ListFolder

func ListFolder(ctx context.Context, folderIds []int64, userId int64) (folder []*model.Folder, err error)

func LoadFile

func LoadFile(ctx context.Context, folderId, fileId, userId int64) (file *model.File, err error)

func LoadFolder

func LoadFolder(ctx context.Context, id, userId int64, isLoadRelated bool) (folder *model.Folder, err error)

func LoadFolderFilesByFolderIdAndFileIds

func LoadFolderFilesByFolderIdAndFileIds(ctx context.Context, folderId int64, fileIds []int64, userId int64) (folderFiles []*model.WrapFolderFile, err error)

func LoadFolderFilesByFolderIds

func LoadFolderFilesByFolderIds(ctx context.Context, folderIds []int64, userId int64) (folderFiles []*model.WrapFolderFile, err error)

func LoadSimpleFolder

func LoadSimpleFolder(ctx context.Context, id, userId int64) (folder *model.SimpleFolder, err error)

func MoveFile

func MoveFile(ctx context.Context, fromId, toId int64, fileIds []int64) (err error)

func MoveFolder

func MoveFolder(ctx context.Context, to *model.Folder, ids []int64) (err error)

func NewContext

func NewContext(ctx context.Context, s Service) context.Context

func NewFileService

func NewFileService(fs model.FileStore) model.FileService

func NewFolderService

func NewFolderService(ds model.FolderStore) model.FolderService

func NewGroupService

func NewGroupService(gs model.GroupStore) model.GroupService

func NewShareService

func NewShareService(ss model.ShareStore) model.ShareService

func NewTicketService

func NewTicketService(ts model.TicketStore, ticketTTL time.Duration) model.TicketService

func RenameFile

func RenameFile(ctx context.Context, folderId, fileId int64, newName string) (err error)

func RenameFolder

func RenameFolder(ctx context.Context, id, currentFolderId int64, newName string) (err error)

func SaveFileToFolder

func SaveFileToFolder(ctx context.Context, file *model.File, folderId int64) (err error)

func TicketDestroy

func TicketDestroy(ctx context.Context, ticketId string) error

func TicketIsValid

func TicketIsValid(ctx context.Context, ticketId string) (isValid bool, userId int64, err error)

func UserList

func UserList(ctx context.Context, offset, limit int64) (user []*model.User, count int64, err error)

func UserListByUserIds

func UserListByUserIds(ctx context.Context, userIds []interface{}) ([]*model.User, error)

func UserLoad

func UserLoad(ctx context.Context, id int64) (*model.User, error)

func UserLoadAndRelated

func UserLoadAndRelated(ctx context.Context, id int64) (*model.User, error)

func UserLogin

func UserLogin(ctx context.Context, account, password string) (*model.Ticket, error)

func UserRegister

func UserRegister(ctx context.Context, account string, certificateType model.CertificateType, password string) (userId int64, err error)

func UserUpdate

func UserUpdate(ctx context.Context, userId int64, data map[string]interface{}) error

func UserUpdateBanStatus

func UserUpdateBanStatus(ctx context.Context, userId int64, newBanStatus bool) error

func UserUpdatePassword

func UserUpdatePassword(ctx context.Context, userId int64, newPassword string) error

func UserUpdateUsedStorage

func UserUpdateUsedStorage(ctx context.Context, userId int64, storage uint64, operator string) error

Types

Jump to

Keyboard shortcuts

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